#include <bits/stdc++.h>
using namespace std;
int a[310][310], c[3];
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> c[i];
  if (N != 2)
    if (!(c[0] ^ c[1] ^ c[2]))
      cout << "BitAryo" << endl;
    else
      cout << "BitLGM" << endl;
  else {
    for (int i = 0; i < 300; i++)
      for (int j = 0; j < 300; j++)
        if (a[i][j] == 0) {
          for (int k = j + 1; k < 300; k++) a[i][k] = 1;
          for (int k = i + 1; k < 300; k++) a[k][j] = 1;
          for (int k = 1; i + k < 300 && j + k < 300; k++) a[i + k][j + k] = 1;
        }
    if (a[c[0]][c[1]] == 1)
      cout << "BitLGM" << endl;
    else
      cout << "BitAryo" << endl;
  }
  return 0;
}
