As a average OIer who had never left your home, you don't have the ability to distinguish between "tree" and "grass".

But today, you are forced to leave your home for a OI contest. To get to the contest venue, you need to walk through a path with a lot of plants.

There are $N$ plants arranged on a path. Plant $1$ is at the leftmost and plant $N$ is at the rightmost. Plant $i$ has the height $A_i$. You are so curious about these plants, but you don't even know what kind of plants they are!

Therefore, you come up a strategy to guess the type of them:
> First, arrive in front of plant $1$ and guess it is "grass".
> Then, walk along the path from left to right. For each plant you see, if its height is greater than the average height of plants you have seen previously, you guess it is a "tree", or else you guess it is a "grass".

You need to output a string of $N$ characters. For the i-th character, output T if you guess the i-th plant is a tree or G otherwise.

Input Specification

The first line consists of a integer $N$, the number of plants.
The second line consists of $N$ integers representing $A_i$ , the height of the trees.

Output Specification

Output a single line consists of a string of length $N$, where each character is either T or G.

Subtasks

For all cases,
$1\le N \le 10^5$
$1\le A_i \le 10^9$

Subtask 1: $N=1$ (10 pts)
Subtask 2: $N\le 1000$, $A_i \le 100$ (30 pts)
Subtask 3: $A_i \le 100$ (30 pts)
Subtask 4: No additional constraints (30 pts)

Sample Test Cases

Input Output
5
3 2 4 3 10
GGTGT
Click to copy.

Scoring: Per Subtask
Authored by s22l19
Appeared in 2026 Mini Comp 1 [WY Interschool Pre-CCC]