%{
#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");
}
