%{
#include <stdio.h>
int yylex();
void yyerror(const char* s);
int t = 0;
%}
%token '(' ')'
%%
input: /* empty */
| input '(' input ')'
;
%%
void yyerror(const char* s) {
t = 1;
}
int main() {
yyparse();
if (t == 0)
printf("Parentheses are well-formed.\n");
else
printf("Not well-formed.\n");
}
JXsKI2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgeXlsZXgoKTsKdm9pZCB5eWVycm9yKGNvbnN0IGNoYXIqIHMpOwoKaW50IHQgPSAwOwolfQoKJXRva2VuICcoJyAnKScKCiUlCgppbnB1dDogLyogZW1wdHkgKi8KICAgICB8IGlucHV0ICcoJyBpbnB1dCAnKScKICAgICA7CgolJQoKdm9pZCB5eWVycm9yKGNvbnN0IGNoYXIqIHMpIHsKICAgIHQgPSAxOwp9CgppbnQgbWFpbigpIHsKICAgIHl5cGFyc2UoKTsKICAgIGlmICh0ID09IDApCiAgICAgICAgcHJpbnRmKCJQYXJlbnRoZXNlcyBhcmUgd2VsbC1mb3JtZWQuXG4iKTsKICAgIGVsc2UKICAgICAgICBwcmludGYoIk5vdCB3ZWxsLWZvcm1lZC5cbiIpOwp9Cg==