#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
inline void ans(string s) {
  cout << s << endl;
  exit(0);
}
const int MAXN = 305;
int n;
int X, Y, Z;
int f[MAXN][MAXN];
int rec(int x, int y) {
  if (f[x][y] != -1) return f[x][y];
  for (int dx = 1; dx <= x; ++dx) {
    if (!rec(x - dx, y)) return f[x][y] = 1;
  }
  for (int dy = 1; dy <= y; ++dy) {
    if (!rec(x, y - dy)) return f[x][y] = 1;
  }
  for (int d = 1; d <= min(x, y); ++d) {
    if (!rec(x - d, y - d)) return f[x][y] = 1;
  }
  return f[x][y] = 0;
}
int main() {
  cin >> n;
  if (n == 1) {
    cin >> X;
    if (X)
      ans("BitLGM");
    else
      ans("BitAryo");
  }
  if (n == 3) {
    cin >> X >> Y >> Z;
    if (X ^ Y ^ Z)
      ans("BitLGM");
    else
      ans("BitAryo");
  }
  cin >> X >> Y;
  memset(f, -1, sizeof f);
  if (rec(X, Y))
    ans("BitLGM");
  else
    ans("BitAryo");
  return 0;
}
