#include <bits/stdc++.h>
using namespace std;
int a[5], Sg[307][307][307];
int sg(int x, int y, int z) {
  if (Sg[x][y][z] != -1) return Sg[x][y][z];
  bool v[107];
  memset(v, 0, sizeof v);
  for (int i = 1; i <= x; i++) v[sg(x - i, y, z)] = 1;
  for (int i = 1; i <= y; i++) v[sg(x, y - i, z)] = 1;
  for (int i = 1; i <= z; i++) v[sg(x, y, z - i)] = 1;
  for (int i = 1; i <= min(x, min(y, z)); i++) v[sg(x - i, y - i, z - i)] = 1;
  int p = 0;
  while (v[p]) p++;
  return Sg[x][y][z] = Sg[x][z][y] = Sg[y][x][z] = Sg[y][z][x] = Sg[z][x][y] =
             Sg[z][y][x] = p;
}
int sg2(int x, int y) {
  if (Sg[x][y][0] != -1) return Sg[x][y][0];
  bool v[707];
  memset(v, 0, sizeof v);
  for (int i = 1; i <= x; i++) v[sg2(x - i, y)] = 1;
  for (int i = 1; i <= y; i++) v[sg2(x, y - i)] = 1;
  for (int i = 1; i <= min(x, y); i++) v[sg2(x - i, y - i)] = 1;
  int p = 0;
  while (v[p]) p++;
  return Sg[x][y][0] = Sg[x][0][y] = Sg[y][x][0] = Sg[y][0][x] = Sg[0][x][y] =
             Sg[0][y][x] = p;
}
int main() {
  int n;
  cin >> n;
  memset(Sg, -1, sizeof Sg);
  Sg[0][0][0] = 0;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (n % 2) {
    if (a[1] ^ a[2] ^ a[3]) return !printf("BitLGM");
    return !printf("BitAryo");
  }
  if (n == 2) {
    if (!sg2(a[1], a[2])) return !printf("BitAryo");
    return !printf("BitLGM");
  }
}
