F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

The Simple Programming Language

Time 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
write(¡°q¡±) if(0) write(¡°x¡±) else write(¡°y¡±) if(1) if(0) write(¡°x¡±) else write(¡°y¡±) if(0) if(0) write(¡°x¡±) else write(¡°y¡±)
 

Sample Output
q y y
 

Hint
The 4th test case has no output.
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-06 04:00:47, Gzip enabled