CF1950A.Stair, Peak, or Neither?

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Stair, Peak, or Neither?

You are given three digits aa, bb, and cc. Determine whether they form a stair, a peak, or neither.

  • A stair satisfies the condition a<b<ca \lt b \lt c.
  • A peak satisfies the condition a<b>ca \lt b \gt c.

Input

The first line contains a single integer tt (1≤t≤10001 \leq t \leq 1000) — the number of test cases.

The only line of each test case contains three digits aa, bb, cc (0≤a0 \leq a, bb, c≤9c \leq 9).

Output

For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Samples

7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

在线编程 IDE

建议全屏模式获得最佳体验