#include <bits/stdc++.h>
using namespace std;
int tab2[305][305];
int tab3[305][305][305];
int check2(int x, int y) {
  if (0 == x && 0 == y) return 1;
  int Min = x < y ? x : y;
  for (int i = Min; i >= 0; i--)
    if (1 == tab2[x - i][y - i]) return 0;
  for (int i = 0; i <= y; i++)
    if (1 == tab2[x][i]) return 0;
  for (int i = 0; i <= x; i++)
    if (1 == tab2[i][y]) return 0;
  return 1;
}
void mark2(int x, int y) {
  for (int i = 0;; i++) {
    if (x + i > 303 || y + i > 303) break;
    tab2[x + i][y + i] = 0;
  }
  for (int i = 0; i < 303; i++) {
    tab2[x][i] = 0;
    tab2[i][y] = 0;
  }
  tab2[x][y] = 1;
}
void inital2() {
  memset(tab2, -1, sizeof(tab2));
  for (int i = 0; i < 303; i++)
    for (int j = 0; j < 303; j++) {
      if (tab2[i][j] != -1) continue;
      if (check2(i, j)) {
        mark2(i, j);
        mark2(j, i);
      }
    }
}
int check3(int x, int y, int z) {
  if (0 == x && 0 == y && 0 == z) return 1;
  int Min = x < y ? x : y;
  Min = Min < z ? Min : z;
  for (int i = Min; i >= 0; i--)
    if (1 == tab3[x - i][y - i][z - i]) return 0;
  for (int i = 0; i <= z; i++)
    if (1 == tab3[x][y][i]) return 0;
  for (int i = 0; i <= y; i++)
    if (1 == tab3[x][i][z]) return 0;
  for (int i = 0; i <= x; i++)
    if (1 == tab3[i][y][z]) return 0;
  return 1;
}
void mark3(int x, int y, int z) {
  for (int i = 0;; i++) {
    if (x + i > 303 || y + i > 303 || z + i > 303) break;
    tab3[x + i][y + i][z + i] = 0;
  }
  for (int i = 0; i < 303; i++) {
    tab3[x][y][i] = 0;
    tab3[x][i][z] = 0;
    tab3[i][y][z] = 0;
  }
  tab3[x][y][z] = 1;
}
void inital3() {
  memset(tab3, -1, sizeof(tab3));
  for (int i = 0; i < 303; i++)
    for (int j = 0; j < 303; j++)
      for (int k = 0; k < 303; k++) {
        if (tab3[i][j][k] != -1) continue;
        if (check3(i, j, k)) {
          mark3(i, j, k);
          mark3(i, k, j);
          mark3(k, i, j);
          mark3(j, i, k);
          mark3(j, k, i);
          mark3(k, j, i);
        }
      }
}
int main() {
  int n;
  int a[5];
  cin >> n;
  if (1 == n) {
    cin >> a[0];
    if (a[0])
      cout << "BitLGM" << endl;
    else
      cout << "BitAryo" << endl;
  } else if (2 == n) {
    inital2();
    cin >> a[0] >> a[1];
    if (tab2[a[0]][a[1]])
      cout << "BitAryo" << endl;
    else
      cout << "BitLGM" << endl;
  } else if (3 == n) {
    inital3();
    cin >> a[0] >> a[1] >> a[2];
    if (tab3[a[0]][a[1]][a[2]])
      cout << "BitAryo" << endl;
    else
      cout << "BitLGM" << endl;
  }
  return 0;
}
