#include <bits/stdc++.h>
using namespace std;
int n;
int dp2[301][301][2];
int f2(int a1, int a2, int p) {
  if (a1 == 0 && a2 == 0)
    return p;
  else if (dp2[a1][a2][p] != -1)
    return dp2[a1][a2][p];
  bool win = false;
  int p2 = (p + 1) % 2;
  for (int a = 1; a <= a1; ++a) win |= f2(a1 - a, a2, p2) == p2;
  for (int a = 1; a <= a2; ++a) win |= f2(a1, a2 - a, p2) == p2;
  int v = min(a1, a2);
  for (int a = 1; a <= v; ++a) win |= f2(a1 - a, a2 - a, p2) == p2;
  dp2[a1][a2][p] = win ? p2 : p;
  return dp2[a1][a2][p];
}
int main() {
  scanf("%d", &n);
  int a1, a2, a3;
  if (n == 1) {
    int a1;
    scanf("%d", &a1);
    printf("%s\n", a1 == 0 ? "BitAryo" : "BitLGM");
  } else if (n == 2) {
    scanf("%d %d", &a1, &a2);
    memset(dp2, -1, sizeof(dp2));
    printf("%s\n", f2(a1, a2, 0) == 0 ? "BitAryo" : "BitLGM");
  } else {
    scanf("%d %d %d", &a1, &a2, &a3);
    printf("%s\n", (a1 ^ a2 ^ a3) == 0 ? "BitAryo" : "BitLGM");
  }
  return 0;
}
