#include <bits/stdc++.h>
using namespace std;
int n, a[100500];
bool can[400][400];
bool can1[301][301][301];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  if (n == 1) {
    if (a[0] != 0)
      cout << "BitLGM";
    else
      cout << "BitAryo";
    return 0;
  }
  for (int i = 1; i <= 300; i++) {
    can[i][i] = 1;
    can[i][0] = 1;
    can[0][i] = 1;
    can[i][1] = 1;
  }
  can[2][1] = 0;
  for (int i = 3; i <= 300; i++) {
    for (int j = 2; j < i; j++) {
      bool ok = 0;
      for (int d = 1; d < min(i, j); d++) {
        if (!can[i - d][j - d]) {
          ok = 1;
          break;
        }
      }
      if (ok) {
        can[i][j] = 1;
        continue;
      }
      for (int d = 1; d < i; d++) {
        int x = min(i - d, j);
        int y = max(i - d, j);
        if (!can[y][x]) {
          ok = 1;
          break;
        }
      }
      if (ok) {
        can[i][j] = 1;
        continue;
      }
      for (int d = 1; d < j; d++) {
        int x = min(j - d, i);
        int y = max(j - d, i);
        if (!can[y][x]) {
          ok = 1;
          break;
        }
      }
      if (ok) {
        can[i][j] = 1;
        continue;
      }
      can[i][j] = 0;
    }
  }
  if (n == 2) {
    reverse(a, a + n);
    if (can[a[0]][a[1]])
      cout << "BitLGM";
    else
      cout << "BitAryo";
    return 0;
  }
  int x = a[0];
  for (int i = 1; i < n; i++) x ^= a[i];
  if (x > 0)
    cout << "BitLGM";
  else
    cout << "BitAryo";
  return 0;
}
