#include <bits/stdc++.h>
using namespace std;
bool mark[400];
bool num[310][310];
void makeNum() {
  memset(mark, 0, sizeof(mark));
  memset(num, 0, sizeof(num));
  num[0][0] = 1;
  mark[0] = 1;
  int st = 1;
  int l = 0, r = 0;
  while (r < 305) {
    while (mark[l]) l++;
    r = l + st;
    st++;
    num[l][r] = num[r][l] = 1;
    mark[l] = mark[r] = 1;
  }
  return;
}
int main() {
  int n;
  double ee = (sqrt(5) + 1) / 2;
  makeNum();
  while (scanf("%d", &n) != EOF) {
    if (n == 1) {
      int a;
      scanf("%d", &a);
      if (a)
        printf("BitLGM\n");
      else
        printf("BitAryo\n");
      continue;
    }
    if (n == 2) {
      int a, b;
      scanf("%d %d", &a, &b);
      if (num[a][b])
        printf("BitAryo\n");
      else
        printf("BitLGM\n");
    }
    if (n == 3) {
      int a, b, c;
      scanf("%d %d %d", &a, &b, &c);
      if ((a ^ b ^ c) == 0)
        printf("BitAryo\n");
      else
        printf("BitLGM\n");
    }
  }
  return 0;
}
