#include <bits/stdc++.h>
using namespace std;
int state[301][301];
bool get_state(int x, int y) {
  if (state[x][y] != -1) return state[x][y];
  for (int i = 1; i <= min(x, y); ++i)
    if (get_state(x - i, y - i) == 0) {
      state[x][y] = 1;
      return 1;
    }
  for (int i = 1; i <= x; ++i)
    if (get_state(x - i, y) == 0) {
      state[x][y] = 1;
      return 1;
    }
  for (int i = 1; i <= y; ++i)
    if (get_state(x, y - i) == 0) {
      state[x][y] = 1;
      return 1;
    }
  state[x][y] = 0;
  return 0;
}
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    int x;
    scanf("%d", &x);
    if (x == 0)
      printf("BitAryo\n");
    else
      printf("BitLGM\n");
  } else if (n == 2) {
    int x, y;
    scanf("%d %d", &x, &y);
    memset(state, -1, sizeof state);
    if (get_state(x, y))
      printf("BitLGM\n");
    else
      printf("BitAryo\n");
  } else {
    int x, y, z;
    scanf("%d %d %d", &x, &y, &z);
    if (x ^ y ^ z)
      printf("BitLGM\n");
    else
      printf("BitAryo\n");
  }
  return 0;
}
