#include <bits/stdc++.h>
using namespace std;
const int MAX = 360;
unsigned short l_third[MAX][MAX];
unsigned short l_big[MAX][MAX];
bool win[MAX][MAX][MAX];
bool getwin(unsigned short a, unsigned short b, unsigned short c) {
  if (a == b and b == c and c == 0) return false;
  if (l_third[a][b] < c or l_third[b][c] < a or l_third[a][c] < b) return true;
  if (l_big[c - b][b - a] < c) return true;
  return false;
}
bool getwin2(unsigned short a, unsigned short b) {
  if (a == b and b == 0) return false;
  if (l_third[a][0] < b or l_third[b][0] < a) return true;
  if (l_big[b - a][0] < b) return true;
  return false;
}
inline void mn(unsigned short &a, unsigned short b) { a = min(a, b); }
void fill2() {
  for (unsigned short i = 0; i < MAX; ++i) l_big[i][0] = l_third[i][0] = 400;
  for (unsigned short i = 0; i < MAX; ++i)
    for (unsigned short j = i; j < MAX; ++j) {
      bool w = getwin2(i, j);
      if (w == false) {
        mn(l_third[i][0], j);
        mn(l_third[j][0], i);
        mn(l_big[j - i][0], j);
      }
      win[i][j][0] = w;
    }
}
void fill3() {
  for (unsigned short i = 0; i < MAX; ++i)
    for (unsigned short j = 0; j < MAX; ++j)
      l_big[i][j] = l_third[i][j] = (-1u / 2);
  for (unsigned short i = 0; i < MAX; ++i)
    for (unsigned short j = i; j < MAX; ++j)
      for (unsigned short k = j; k < MAX; ++k) {
        bool w = getwin(i, j, k);
        win[i][j][k] = w;
        if (w == false) {
          mn(l_third[i][j], k);
          mn(l_third[i][k], j);
          mn(l_third[j][k], i);
          mn(l_big[k - j][j - i], k);
        }
      }
}
int main() {
  unsigned short n;
  cin >> n;
  unsigned short a[3] = {};
  for (unsigned short i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  if (n == 3)
    fill3();
  else if (n == 2)
    fill2();
  else {
    if (a[0] == 0)
      cout << "BitAryo" << endl;
    else
      cout << "BitLGM" << endl;
    return 0;
  }
  if (win[a[0]][a[1]][a[2]])
    cout << "BitLGM" << endl;
  else
    cout << "BitAryo" << endl;
  return 0;
}
