#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e+9 + 7;
const long long MAXN = 1e+3 + 7;
const long long tMAXN = 3e+2;
const long long INF = 1e+18;
long long n;
long long dp[MAXN][MAXN];
long long a, b, c;
void doDP() {
  memset(dp, 0, sizeof(dp));
  dp[1][1] = 1;
  for (long long i = (0); i <= tMAXN; i++) {
    for (long long j = (0); j <= tMAXN; j++) {
      if (dp[i][j]) {
        continue;
      }
      for (long long k = (1); k <= tMAXN; k++) {
        dp[i + k][j] = 1;
        dp[i][j + k] = 1;
        dp[i + k][j + k] = 1;
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  if (n == 1) {
    cin >> a;
    if (a == 0)
      cout << "BitAryo";
    else
      cout << "BitLGM";
  } else if (n == 2) {
    cin >> a >> b;
    doDP();
    if (dp[a][b])
      cout << "BitLGM";
    else
      cout << "BitAryo";
  } else {
    cin >> a >> b >> c;
    if ((a ^ b ^ c) == 0)
      cout << "BitAryo";
    else
      cout << "BitLGM";
  }
}
