|
||||||||||
The Simple Programming LanguageTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 540 Accepted Submission(s): 150 Problem Description Consider the following programming language. This language contains only two types of statements: simple statements and compound statements. The simple statement is in the form ¡°write (literal)¡±, where ¡°write¡± is a key word indicating that the content of the literal should be written to the standard output. The content of literals is surrounded by a pair of double quotes. The compound statement is in the form ¡°if (<expression>) <statement>¡± or ¡°if (<expression>) <statement> else <statement>¡±. Here ¡°if¡± and ¡°else¡± are key words and ¡°expression¡± can be either ¡°1¡± or ¡°0¡± indicating ¡°true¡± or ¡°false¡±. Statement can be either compound or simple, which means compound statements can be nested. Note that each ¡°else¡± should match the nearest ¡°if¡±. Input The input has multiple test cases. Every test case is exactly a statement. Every test case is ended with an empty line and there will be no empty lines within a statement. Please pay attention that empty lines separate the statements and adjacent statements are independent of each other. Output For all the contents of literals that should be written to the standard output, print them on a single line, without the double quotes. The contents of literals will contain only lower case letters. Sample Input
Sample Output
Hint The 4th test case has no output. Source | ||||||||||
|