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
#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-11;
int n, k;
int a[3];
bool b[401][401][401];
int main() {
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> a[i];
  if (n == 0)
    cout << "BitAryo";
  else if (n == 1) {
    if (a[0] == 0)
      cout << "BitAryo";
    else
      cout << "BitLGM";
  } else if (n == 2) {
    int first = 0, second = 0;
    bool b[400][400];
    memset(b, 0, sizeof(b));
    while (first <= 300) {
      while (b[first][second]) {
        second++;
        if (second > 300) {
          first++;
          second = first;
        }
      }
      for (int i = first + 1; i <= 300; i++) {
        b[i][second] = 1;
        b[second][i] = 1;
      }
      for (int i = second + 1; i <= 300; i++) {
        b[first][i] = 1;
        b[i][first] = 1;
      }
      for (int i = 1; i + first <= 300 && i + second <= 300; i++) {
        b[i + first][i + second] = 1;
        b[i + second][i + first] = 1;
      }
      second++;
      if (second > 300) {
        first++;
        second = first;
      }
    }
    if (!b[a[0]][a[1]])
      cout << "BitAryo";
    else
      cout << "BitLGM";
  } else {
    int first = 0, second = 0, z = 0;
    memset(b, 0, sizeof(b));
    while (first <= 300) {
      while (b[first][second][z]) {
        z++;
        if (z > 300) {
          second++;
          z = second;
        }
        if (second > 300) {
          first++;
          second = first;
          z = first;
        }
      }
      for (int i = first + 1; i <= 300; i++) {
        b[i][second][z] = 1;
        b[i][z][second] = 1;
        b[second][i][z] = 1;
        b[z][i][second] = 1;
        b[second][z][i] = 1;
        b[z][second][i] = 1;
      }
      for (int i = second + 1; i <= 300; i++) {
        b[i][first][z] = 1;
        b[i][z][first] = 1;
        b[first][i][z] = 1;
        b[z][i][first] = 1;
        b[first][z][i] = 1;
        b[z][first][i] = 1;
      }
      for (int i = z + 1; i <= 300; i++) {
        b[i][first][second] = 1;
        b[i][second][first] = 1;
        b[first][i][second] = 1;
        b[second][i][first] = 1;
        b[first][second][i] = 1;
        b[second][first][i] = 1;
      }
      for (int i = 1; i + first <= 300 && i + second <= 300 && i + z <= 300;
           i++)
        b[i][i][i] = 1;
      z++;
      if (z > 300) {
        second++;
        z = second;
      }
      if (second > 300) {
        first++;
        second = first;
        z = first;
      }
    }
    if (!(a[0] ^ a[1] ^ a[2]))
      cout << "BitAryo";
    else
      cout << "BitLGM";
  }
  return 0;
}
