#include <bits/stdc++.h>
using namespace std;
const int MAXN = 333;
int gr[MAXN][MAXN];
bool is[500];
int mex() {
  for (int i = 0;; ++i)
    if (!is[i]) return i;
  return -1;
}
int main() {
  int L = 301;
  for (int i = 0; i <= L; ++i) gr[i][0] = gr[0][i] = i;
  for (int i = 1; i <= L; ++i) {
    for (int j = 1; j <= L; ++j) {
      memset(is, false, sizeof(is));
      for (int k = 1; k <= i; ++k) is[gr[i - k][j]] = true;
      for (int k = 1; k <= j; ++k) is[gr[i][j - k]] = true;
      for (int k = 1; k <= min(i, j); ++k) is[gr[i - k][j - k]] = true;
      gr[i][j] = mex();
    }
  }
  int n;
  cin >> n;
  if (n == 1) {
    int a;
    cin >> a;
    if (a)
      cout << "BitLGM" << endl;
    else
      cout << "BitAryo" << endl;
  } else if (n == 3) {
    int a, b, c;
    cin >> a >> b >> c;
    if ((a ^ b ^ c) != 0)
      cout << "BitLGM" << endl;
    else
      cout << "BitAryo" << endl;
  } else {
    int a, b;
    cin >> a >> b;
    if (gr[a][b])
      cout << "BitLGM" << endl;
    else
      cout << "BitAryo" << endl;
  }
  return 0;
}
