#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
long long mod = 1000000007LL;
long long mod2 = 998244353LL;
int n;
int a[302];
int main() {
  cin >> n;
  if (n == 1) {
    scanf("%d", &a[1]);
    if (a[1] == 0) {
      cout << "BitAryo" << endl;
    } else {
      cout << "BitLGM" << endl;
    }
  } else if (n == 2) {
    scanf("%d%d", &a[1], &a[2]);
    if (a[1] > a[2]) {
      swap(a[1], a[2]);
    }
    int dp[302][302];
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i <= a[1]; ++i) {
      for (int j = 0; j <= a[2]; ++j) {
        if (i == 0 && j == 0) continue;
        if (i == 0 || j == 0) {
          dp[i][j] = 1;
        } else {
          int minv = min(i, j);
          dp[i][j] = 1;
          for (int k = 1; k <= minv; ++k) {
            dp[i][j] &= dp[i - k][j - k];
          }
          for (int k = 1; k <= i; ++k) {
            dp[i][j] &= dp[i - k][j];
          }
          for (int k = 1; k <= j; ++k) {
            dp[i][j] &= dp[i][j - k];
          }
          dp[i][j] = !dp[i][j];
        }
      }
    }
    if (dp[a[1]][a[2]]) {
      cout << "BitLGM" << endl;
    } else {
      cout << "BitAryo" << endl;
    }
  } else {
    scanf("%d%d%d", &a[1], &a[2], &a[3]);
    int res = a[1] ^ a[2] ^ a[3];
    if (res)
      cout << "BitLGM" << endl;
    else
      cout << "BitAryo" << endl;
  }
  return 0;
}
