Early languages like Fortran IV used conditional and unconditional goto statements instead of structured statements such as if and while. In Fortran IV, each statement occupies one input line. The first five character positions of every line are reserved for an optional label, which is an integer. The sixth position is reserved for a continuation marker, which we will not consider further. Statements therefore occupy positions 7 and beyond on each line.
The unconditional goto statement looks like this:
goto label
and the conditional goto statement looks like this:
if(expression)goto label
The language contains many other statements, but only the conditional goto begins with if( and ends with )goto label, where label is an integer. All spaces are ignored inside a Fortran IV statement. For this problem the stop statement, which halts execution, appears only as the last line of a program.
Your job is to decide whether two Fortran programs are equivalent. They are equivalent if, for every possible input, they execute exactly the same sequence of statements, ignoring unconditional gotos and labels. By "the same sequence of statements" we mean statements that are textually identical after spaces and labels have been removed. You must assume that each conditional goto is taken for some inputs and not taken for others; unconditional gotos are, of course, always taken. The two example programs are equivalent.
The input consists of two programs separated by a blank line. No input line exceeds 80 characters, and no program contains more than 1000 lines. Each label used in a goto statement appears to the left of exactly one statement; no label is repeated.
Print a single line containing either The programs are equivalent. or The programs are not equivalent.