282_D. Yet Another Number Game_10268
Since most contestants do not read this part, I have to repeat that Bitlandians are quite weird. They have their own jobs, their own working method, their own lives, their own sausages and their own games!

Since you are so curious about Bitland, I'll give you the chance of peeking at one of these games.

BitLGM and BitAryo are playing yet another of their crazy-looking genius-needed Bitlandish games. They've got a sequence of n non-negative integers a1, a2, ..., an. The players make moves in turns. BitLGM moves first. Each player can and must do one of the two following actions in his turn:

  * Take one of the integers (we'll denote it as ai). Choose integer x (1 ≤ x ≤ ai). And then decrease ai by x, that is, apply assignment: ai = ai - x. 
  * Choose integer x <image>. And then decrease all ai by x, that is, apply assignment: ai = ai - x, for all i. 



The player who cannot make a move loses.

You're given the initial sequence a1, a2, ..., an. Determine who wins, if both players plays optimally well and if BitLGM and BitAryo start playing the described game in this sequence.

Input

The first line contains an integer n (1 ≤ n ≤ 3).

The next line contains n integers a1, a2, ..., an (0 ≤ ai < 300).

Output

Write the name of the winner (provided that both players play optimally well). Either "BitLGM" or "BitAryo" (without the quotes).

Examples

Input

2
1 1


Output

BitLGM


Input

2
1 2


Output

BitAryo


Input

3
1 2 1


Output

BitLGM
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;

public class ProblemD {
	
	static final String FIRST = "BitLGM";
	static final String SECOND = "BitAryo";
	
	static int[][] memo2;
	
	static int game2(int a, int b) {
		if (memo2[a][b] != 0) {
			return memo2[a][b];
		}
		boolean canbeat = false;
		for (int i = 1 ; i <= a ; i++) {
			if (game2(a-i, b) == -1) {
				canbeat = true;
			}
		}
		for (int i = 1 ; i <= b ; i++) {
			if (game2(a, b-i) == -1) {
				canbeat = true;
			}
		}
		for (int i = 1 ; i <= Math.min(a, b) ; i++) {
			if (game2(a-i, b-i) == -1) {
				canbeat = true;
			}
		}
		memo2[a][b] = canbeat ? 1 : -1;
		return memo2[a][b];
	}
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int a = in.nextInt();
		if (n == 1) {
			out.println(a >= 1 ? FIRST : SECOND);
		} else if (n == 2) {
			int b = in.nextInt();
			memo2 = new int[300][300];
			memo2[0][0] = -1;
			out.println(game2(a, b) == 1 ? FIRST : SECOND);
		} else {
			int b = in.nextInt();
			int c = in.nextInt();
			int min = Math.min(a, Math.min(b, c));
			int max = Math.max(a, Math.max(b, c));
			int med = a + b + c - min - max;
			out.println((min^med) != max ? FIRST : SECOND);
		}
		
		out.flush();
	}
	

	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}
}

2
1 1
 3
1 2 1
 2
1 2
 3
299 290 288
 3
124 47 228
 2
41 29
 2
15 9
 3
299 299 298
 3
4 19 23
 1
6
 2
183 113
 3
0 87 87
 3
299 299 299
 2
159 98
 2
80 130
 3
222 129 95
 2
6 10
 1
231
 2
3 5
 2
40 65
 3
0 0 0
 3
101 186 223
 2
125 123
 2
216 91
 2
230 142
 1
291
 1
248
 2
218 142
 1
213
 2
58 94
 3
49 252 205
 3
70 45 107
 2
200 185
 2
14 23
 3
0 173 173
 2
44 27
 3
31 132 7
 2
140 193
 2
106 227
 2
17 28
 2
241 289
 3
15 150 153
 3
234 44 69
 2
0 0
 3
49 126 79
 1
299
 3
119 251 222
 3
254 227 29
 1
99
 2
298 184
 3
244 241 295
 2
62 38
 2
218 127
 1
234
 2
298 281
 3
9 183 275
 3
184 222 102
 2
29 47
 2
16 26
 3
181 232 93
 3
103 286 100
 1
2
 2
295 182
 3
144 33 177
 2
11 222
 2
143 88
 2
162 100
 3
50 69 119
 2
1 3
 3
19 88 202
 2
69 112
 1
15
 3
152 66 218
 2
280 24
 3
162 230 68
 1
85
 2
152 246
 2
173 280
 2
164 101
 2
124 194
 2
293 181
 1
0
 2
144 233
 2
9 10
 2
49 30
 1
147
 2
6 8
 2
59 96
 2
251 155
 3
151 97 120
 2
280 173
 2
299 299
 2
114 185
 2
180 111
 2
2 1
 2
13 8
 1
1
 2
70 43
 2
150 243
 3
190 61 131
 3
275 70 60
 1
108
 2
223 58
 1
10
 3
191 50 141
 2
298 299
 3
134 244 95
 3
129 148 141
 3
38 16 54
 3
196 45 233
 2
156 253
 3
124 47 141
 2
36 29
 2
14 9
 3
4 37 23
 1
11
 2
183 209
 3
1 87 87
 3
299 299 153
 2
48 98
 2
113 130
 3
264 129 95
 2
6 18
 2
3 6
 2
40 116
 3
111 186 223
 2
78 123
 2
216 97
 1
68
 2
72 142
 1
293
 2
46 94
 3
49 204 205
 3
70 18 107
 2
75 185
 2
6 23
 3
0 146 173
 2
22 27
 3
31 151 7
 2
177 193
 2
53 227
 2
17 3
 2
298 289
 3
15 150 119
 3
234 58 69
 2
0 1
 3
72 126 79
 1
73
 3
119 118 222
 3
254 227 11
 1
113
 3
235 241 295
 2
0 38
 2
218 236
 2
282 281
 3
9 161 275
 2
29 71
 2
21 26
 3
181 34 93
 3
46 286 100
 1
4
 2
295 183
 3
144 33 272
 2
11 111
 2
143 83
 2
162 101
 3
93 69 119
 2
1 0
 3
19 139 202

BitLGM
 BitLGM
 BitAryo
 BitLGM
 BitLGM
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitLGM
 BitAryo
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitLGM
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitLGM
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitLGM
 BitAryo
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitAryo
 BitLGM
 BitLGM
 BitAryo
 BitAryo
 BitLGM
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitAryo
 BitLGM
 BitLGM
 BitLGM
 BitAryo
 BitAryo
 BitAryo
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
 BitLGM
