시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB0000.000%

문제

Computers are great tools for storing, editing, and presenting textual information. When presenting text, one of the most important factors is where to place newlines. For this problem, you should write a program that re-formats text according to a simple set of rules and special markers in the source text.

입력

The input is a sequence of tokens separated by whitespace (each separator is a single space or newline). All non-whitespace tokens are considered normal except for two special tokens: “N” and “END”. The “N” token indicates that a newline should be inserted into the text, and the “END” token indicates the end of input.

출력

Print out each normal token followed by a space. For each occurrence of the special token “N”, print a newline.

예제 입력 1

A
man provided
with paper, N pencil, N and
rubber, N and
subject to strict
discipline, N is in
effect a
universal machine. N N A. M.
Turing N END

예제 출력 1

A man provided with paper,
pencil,
and rubber,
and subject to strict discipline,
is in effect a universal machine.

A. M. Turing