1721 - Strange Dialog 1721 - Strange Dialog 1721 - Strange Dialog

Statistics Sub: 545 | AC: 176 | AC%: 32,29 | Score: 1,14
Created by Timus Online Judge - Leonid Volkov
Added by jlcastrillon (2012-03-06)
Limits
Total Time: 2000 MS |Memory: 62 MB | Output: 64 MB | Size: 29 KB
Enabled languages
Available in

Description

One entity named "one" is talking with his friend "puton" and their conversation is interesting. "one" can say words "out" , "output" and "puton". "puton" can say words "in", "input" and "one". They understand each other perfectly and even write dialogues in strings without spaces. You have N strings. Find which of them are dialogues.
;jsessionid=2899394BE63F0C275DD4FD19A46A4821
One entity named "one" is talking with his friend "puton" and their conversation is interesting. "one" can say words "out" , "output" and "puton". "puton" can say words "in", "input" and "one". They understand each other perfectly and even write dialogues in strings without spaces. You have N strings. Find which of them are dialogues.
;jsessionid=2899394BE63F0C275DD4FD19A46A4821
One entity named "one" is talking with his friend "puton" and their conversation is interesting. "one" can say words "out" , "output" and "puton". "puton" can say words "in", "input" and "one". They understand each other perfectly and even write dialogues in strings without spaces. You have N strings. Find which of them are dialogues.
;jsessionid=2899394BE63F0C275DD4FD19A46A4821

Input specification

In the first line of input there is one non-negative integer N <= 300. Next N lines contain non-empty strings. Each string consists of at most 10^5 small Latin letters.
In the first line of input there is one non-negative integer N <= 300. Next N lines contain non-empty strings. Each string consists of at most 10^5 small Latin letters.
In the first line of input there is one non-negative integer N <= 300. Next N lines contain non-empty strings. Each string consists of at most 10^5 small Latin letters.

Output specification

Output consists of N lines. Line contains word "YES", if the string is a dialogue of "one" and "puton", otherwise "NO".
Output consists of N lines. Line contains word "YES", if the string is a dialogue of "one" and "puton", otherwise "NO".
In the first line of input there is one non-negative integer N <= 300. Next N lines contain non-empty strings. Each string consists of at most 10^5 small Latin letters.

Sample input

4
putonone
inoneputin
oneininputwooutoutput
inputonoutput

Sample output

YES
NO
NO
YES

Hint(s)

http://coj.uci.cu/24h/
http://coj.uci.cu/24h/
http://coj.uci.cu/24h/

Recommendation

We have carefully selected several similar problems: 3380 | 3166 | 3375 | 2623 | 3667 | 4001