Timus 1102. Strange Dialog requires that the given input be judged to be a legitimate conversation.
1102. Strange Dialog
Time limit:1.0 Second
Memory limit:16 MB
One entity named "one" tells with his friend "Puton" and their are conversation. "One" can say words "out" and "output", besides him calls his friend by name. "Puton" can say words "in", "input" and "one". They understand each of perfect and even write dialogue in strings without.
You have N strings. Find which of them are dialogues.
Input
In the ' I ' of input there is one non-negative integer n≤1000. Next N lines contain non-empty strings. Each string consists of small Latin letters. Total length of ' all strings ' no more then7 characters.
Output
Output consists of N lines. Line contains word "YES", if string is some dialogue of "one" and "Puton", otherwise "NO".
Sample
| input |
Output |
| 6 Puton Inonputin Oneputonininputoutoutput Oneininputwooutoutput Outpu Utput |
YES NO YES NO NO NO |
Problem Author:katya Ovechkina
Problem Source:tetrahedron Team Contest May 2001