B. Astra's Gate
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
The dust of history obscures the truth, but inscriptions never lie...

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.

Input

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.

Output

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}$$$.

Example
Input
4
CWNUCPC
HELLOCWNU
ASTRARUINS
CWNUC
Output
SAFE
SAFE
TRAP
SAFE