EDIT1 - Editor

no tags 

Have you ever programmed in Brainf**k? If yes, then you know how annoying it is to press the same key several times in a row. So what we all need, is a good editor. Here are the functions that the editor should have:

  • '\n': begin a new line. If the last line was empty, stop processing and print out all lines.
  • 'd': copy all characters from the current line, and append them after the last character in this line. For example, if current line contains ab, and d is pressed two times, the result will be abababab
  • any other character: append it to the current line.

Please note, that the solution may only be submitted in Brainf**k or Intercal.

Input

There is exactly one test case. You can assume, that there is no key press of 'd' when the line is still empty.

Output

Print the output that the editor described above would produce on the given input. You can assume, that no line is created with more than 150 characters.

Example

Input:

sample-test
-dd-d-dd
end signalled by two newlines

Output: sample-test
--------------------------------------------
enen signalleenen signalle by two newlines


hide comments
(Tjandra Satria Gunawan)(曾毅昆): 2013-04-15 21:31:15

@Mostafa 36a2 (Al3ayesh): You can find 40 more brainf**k problem on new updated TJANDRA page ;-)

Mostafa 36a2: 2012-12-29 16:21:45

Enjoy solving :)
thank you
(we need more BF problems here on spoj)

Riatre Foo: 2012-10-27 10:34:44

Hint: bff-1.0.3.1 uses 32bit cells. REALLY horrible for codes rely on wrapping.

Marwan : 2010-12-19 05:30:17

how can i terminate the input with 2 end lines ?? :D


Added by:Adrian Kuegel
Date:2004-06-12
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:BF ICK
Resource:own problem