#include <bits/stdc++.h>
using namespace std;
bool win[305][305];
void solve() {
  int n;
  cin >> n;
  if (n == 1) {
    int x;
    cin >> x;
    if (x)
      cout << "BitLGM";
    else
      cout << "BitAryo";
    return;
  }
  if (n == 3) {
    int x, y, z;
    cin >> x >> y >> z;
    if (x ^ y ^ z)
      cout << "BitLGM";
    else
      cout << "BitAryo";
    return;
  }
  int x, y;
  cin >> x >> y;
  for (int i = 0; i <= x; i++)
    for (int j = 0; j <= y; j++) {
      if (!i && !j) continue;
      for (int k = 1; k <= i; k++) {
        if (!win[i - k][j]) {
          win[i][j] = true;
          break;
        }
      }
      for (int k = 1; k <= j; k++) {
        if (!win[i][j - k]) {
          win[i][j] = true;
          break;
        }
      }
      for (int k = 1; k <= min(i, j); k++) {
        if (!win[i - k][j - k]) {
          win[i][j] = true;
          break;
        }
      }
    }
  if (win[x][y])
    cout << "BitLGM";
  else
    cout << "BitAryo";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
}
