#include <bits/stdc++.h>
using namespace std;
stringstream ss;
int dp[301][301];
int f(int a, int b) {
  if (a < 0 || b < 0) return 0;
  if (dp[a][b] != -1) return dp[a][b];
  int res = 0;
  for (int i = 1; i <= max(a, b); i++) {
    res |= f(a - i, b);
    res |= f(a, b - i);
    res |= f(a - i, b - i);
  }
  return dp[a][b] = 1 - res;
}
int main() {
  int n, a[3] = {0, 0, 0};
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n == 1) {
    if (a[0])
      cout << "BitLGM" << endl;
    else
      cout << "BitAryo" << endl;
  } else if (n == 2) {
    memset(dp, -1, sizeof dp);
    dp[0][0] = 1;
    if (!f(a[0], a[1]))
      cout << "BitLGM" << endl;
    else
      cout << "BitAryo" << endl;
  } else if (a[0] ^ a[1] ^ a[2])
    cout << "BitLGM" << endl;
  else
    cout << "BitAryo" << endl;
  return 0;
}
