A - 朗読の評価 解説 /

実行時間制限: 2 sec / メモリ制限: 1024 MiB

配点 : 200 点

問題文

国語の授業で N 人の生徒が順番に朗読をしました。 i 番目の生徒の声の大きさは A_i 、読む速さは B_i でした。

先生は、声の大きさが X 以上で、かつ読む速さが Y 以下の朗読を「良い朗読」として G の評価を付け、それ以外には B の評価を付けます。

N 人の評価を、 1 番目の生徒から順に並べた長さ N の文字列として出力してください。

制約

  • 1 \leq N \leq 100
  • 1 \leq X \leq 100
  • 1 \leq Y \leq 100
  • 1 \leq A_i \leq 100
  • 1 \leq B_i \leq 100
  • 入力はすべて整数

入力

入力は以下の形式で標準入力から与えられる。

N X Y
A_1 B_1
A_2 B_2
\vdots
A_N B_N
  • 1 行目には、生徒の人数 N 、声の大きさの基準 X 、速さの基準 Y がスペース区切りで与えられる。
  • 2 行目から N 行にわたり、 1 + i 行目には i 番目の生徒の声の大きさ A_i と速さ B_i がスペース区切りで与えられる。

出力

評価を表す長さ N の文字列を 1 行で出力せよ。


入力例 1

4 50 60
70 40
30 40
80 90
55 20

出力例 1

GBBG

入力例 2

1 10 10
5 5

出力例 2

B

入力例 3

2 20 80
90 10
25 75

出力例 3

GG

入力例 4

4 100 60
50 60
49 60
50 61
1 59

出力例 4

BBBB

入力例 5

1 1 10
5 5

出力例 5

G

Score : 200 pts

Problem Statement

In a Japanese language class, N students took turns reading aloud. The i-th student's voice had loudness A_i and reading speed B_i.

The teacher gives an evaluation of G to a reading whose loudness is at least X and whose speed is at most Y, calling it a "good reading", and gives B to all other readings.

Output the evaluations of the N students as a string of length N, arranged in order from the 1st student.

Constraints

  • 1 \leq N \leq 100
  • 1 \leq X \leq 100
  • 1 \leq Y \leq 100
  • 1 \leq A_i \leq 100
  • 1 \leq B_i \leq 100
  • All inputs are integers.

Input

The input is given from standard input in the following format:

N X Y
A_1 B_1
A_2 B_2
\vdots
A_N B_N
  • The first line contains the number of students N, the loudness threshold X, and the speed threshold Y, separated by spaces.
  • For each i from 1 to N, the (1 + i)-th line contains the i-th student's loudness A_i and speed B_i, separated by a space.

Output

Output one line containing the string of length N representing the evaluations.


Sample Input 1

4 50 60
70 40
30 40
80 90
55 20

Sample Output 1

GBBG

Sample Input 2

1 10 10
5 5

Sample Output 2

B

Sample Input 3

2 20 80
90 10
25 75

Sample Output 3

GG

Sample Input 4

4 100 60
50 60
49 60
50 61
1 59

Sample Output 4

BBBB

Sample Input 5

1 1 10
5 5

Sample Output 5

G