#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double EPS = 1e-6;
bool solve_1(int a, int b = -1, int c = -1) { return a == 0; }
bool solve_2(int a, int b, int c = -1) {
  int lose[305];
  memset(lose, -1, sizeof(lose));
  lose[0] = 0;
  for (int i = 1; i <= 300; i++) {
    bool imp[305];
    memset(imp, false, sizeof(imp));
    for (int j = 0; j < i; j++) {
      if (lose[j] == -1) continue;
      if (lose[j] + (i - j) <= 300) imp[lose[j] + (i - j)] = true;
      imp[lose[j]] = true;
    }
    for (int j = 0; j <= 300; j++)
      if (!imp[j]) {
        lose[i] = j;
        break;
      }
  }
  return lose[a] == b;
}
bool solve_3(int a, int b, int c) { return (a ^ b ^ c) == 0; }
int main() {
  ;
  bool (*FUNC[])(int a, int b, int c) = {solve_1, solve_2, solve_3};
  int n;
  scanf("%d", &n);
  int arr[3] = {-1, -1, -1};
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  puts(FUNC[n - 1](arr[0], arr[1], arr[2]) ? "BitAryo" : "BitLGM");
  return 0;
}

### Prompt

Develop a solution in Cpp to the problem described below:

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

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double EPS = 1e-6;
bool solve_1(int a, int b = -1, int c = -1) { return a == 0; }
bool solve_2(int a, int b, int c = -1) {
  int lose[305];
  memset(lose, -1, sizeof(lose));
  lose[0] = 0;
  for (int i = 1; i <= 300; i++) {
    bool imp[305];
    memset(imp, false, sizeof(imp));
    for (int j = 0; j < i; j++) {
      if (lose[j] == -1) continue;
      if (lose[j] + (i - j) <= 300) imp[lose[j] + (i - j)] = true;
      imp[lose[j]] = true;
    }
    for (int j = 0; j <= 300; j++)
      if (!imp[j]) {
        lose[i] = j;
        break;
      }
  }
  return lose[a] == b;
}
bool solve_3(int a, int b, int c) { return (a ^ b ^ c) == 0; }
int main() {
  ;
  bool (*FUNC[])(int a, int b, int c) = {solve_1, solve_2, solve_3};
  int n;
  scanf("%d", &n);
  int arr[3] = {-1, -1, -1};
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  puts(FUNC[n - 1](arr[0], arr[1], arr[2]) ? "BitAryo" : "BitLGM");
  return 0;
}

```