| “壹零杯”第三届西华师范大学程序设计竞赛 |
|---|
| Закончено |
Explorer Little A has finally arrived at the main structure of the Astra ruins—the "Gate of Astra". The heavy doors are tightly shut, and an ancient inscription consisting of uppercase English letters is carved on them.
According to the first rule of the $$$\textit{China West Normal University (CWNU) Explorer's Survival Guide}$$$: If the inscription on a door contains the contiguous substring $$$\mathtt{CWNU}$$$, then behind the door is a safe supply room; otherwise, there is a deadly dark matter trap!
Now, Little A has transcribed the inscription from the door. Since he is too nervous and his palms are sweating, please help him write a program to determine whether this door is safe or not.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases.
For each test case:
There is a single line containing a string $$$S$$$ ($$$1 \le |S| \le 100$$$) consisting only of uppercase English letters, representing the inscription on the door.
For each test case:
If it is safe behind the door (i.e., the string contains the contiguous substring $$$\mathtt{CWNU})$$$, output $$$\mathtt{SAFE}$$$ on a new line.
Otherwise, output $$$\mathtt{TRAP}$$$.
4CWNUCPCHELLOCWNUASTRARUINSCWNUC
SAFESAFETRAPSAFE
| Название |
|---|


