#include <bits/stdc++.h>
using namespace std;
bool dp[305][305];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  if (n == 1) {
    long long a;
    cin >> a;
    if (a == 0) {
      cout << "BitAryo" << endl;
      return 0;
    }
    cout << "BitLGM" << endl;
    return 0;
  }
  if (n == 2) {
    long long a, b;
    cin >> a >> b;
    for (long long i = 0; i <= a; i++) {
      for (long long j = 0; j <= b; j++) {
        for (long long h = 1; h <= min(i, j); h++) {
          if (!dp[i - h][j - h]) {
            dp[i][j] = 1;
          }
        }
        for (long h = 1; h <= i; h++) {
          if (!dp[i - h][j]) {
            dp[i][j] = 1;
          }
        }
        for (long h = 1; h <= j; h++) {
          if (!dp[i][j - h]) {
            dp[i][j] = 1;
          }
        }
      }
    }
    cout << (dp[a][b] ? "BitLGM" : "BitAryo") << endl;
    return 0;
  }
  long long a, b, c;
  cin >> a >> b >> c;
  long long xr = (a ^ b) ^ c;
  if (xr != 0) {
    cout << "BitLGM" << endl;
  } else {
    cout << "BitAryo" << endl;
  }
}
