#include <bits/stdc++.h>
using namespace std;
bool dp[303][303][303];
bool dp2[303][303];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> a;
  for (long long int i = 1; i <= n; i++) {
    long long int z;
    cin >> z;
    a.push_back(z);
  }
  if (n == 1) {
    if (a[0] == 0) {
      cout << "BitAryo";
      return 0;
    }
    cout << "BitLGM\n";
    return 0;
  } else if (n == 2) {
    for (long long int i = 0; i <= 300; i++) {
      for (long long int j = 0; j <= 300; j++) {
        if (dp2[i][j] == 1) {
          continue;
        }
        for (long long int l = j + 1; l <= 300; l++) {
          dp2[i][l] = 1;
        }
        for (long long int l = i + 1; l <= 300; l++) {
          dp2[l][j] = 1;
        }
        long long int l = 1;
        while ((i + l <= 300) && (j + l <= 300)) {
          dp2[i + l][j + l] = 1;
          l++;
        }
      }
    }
    if (dp2[a[0]][a[1]]) {
      cout << "BitLGM";
    } else {
      cout << "BitAryo";
    }
  } else {
    for (long long int i = 0; i <= 300; i++) {
      for (long long int j = 0; j <= 300; j++) {
        for (long long int k = 0; k <= 300; k++) {
          if (dp[i][j][k] == 1) {
            continue;
          }
          for (long long int l = k + 1; l <= 300; l++) {
            dp[i][j][l] = 1;
          }
          for (long long int l = j + 1; l <= 300; l++) {
            dp[i][l][k] = 1;
          }
          for (long long int l = i + 1; l <= 300; l++) {
            dp[l][j][k] = 1;
          }
          long long int l = 1;
          while ((i + l <= 300) && (j + l <= 300) && (k + l <= 300)) {
            dp[i + l][j + l][k + l] = 1;
            l++;
          }
        }
      }
    }
    if (dp[a[0]][a[1]][a[2]]) {
      cout << "BitLGM";
    } else {
      cout << "BitAryo";
    }
  }
}
