#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e11;
const long long mod = 1e9 + 7;
const long long N = 301;
long long a[3], b[3], mn[N][N], loss[N][N];
set<pair<pair<long long, long long>, long long> > s;
int main() {
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  for (long long i = 0; i < (n); ++i) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < N; i++)
    for (int j = i; j < N; j++) mn[i][j] = inf;
  if (n == 1) {
    if (a[0] == 0)
      cout << "BitAryo";
    else
      cout << "BitLGM";
    return 0;
  }
  if (n == 2) {
    for (int i = 0; i < N; i++) {
      for (int j = i; j < N; j++) {
        long long cnt = 0;
        for (int k = 0; k < i; k++) {
          long long ix = k, jx = j;
          if (ix > jx) swap(ix, jx);
          cnt += loss[ix][jx];
        }
        for (int k = 0; k < j; k++) {
          long long ix = i, jx = k;
          if (ix > jx) swap(ix, jx);
          cnt += loss[ix][jx];
        }
        for (int k = 0; k <= i; k++) cnt += loss[i - k][j - k];
        if (cnt == 0) loss[i][j] = 1;
      }
    }
    if (loss[a[0]][a[1]])
      cout << "BitAryo";
    else
      cout << "BitLGM";
    return 0;
  }
  for (int i = 0; i < N; i++) {
    for (int j = i; j < N; j++) {
      for (int k = j; k < N; k++) {
        long long t;
        t = mn[i][j];
        if (t < k) continue;
        t = mn[i][k];
        if (t < j) continue;
        t = mn[j][k];
        if (t < i) continue;
        for (int l = 0; l <= i; l++)
          if (s.find(make_pair(make_pair(i - l, j - l), k - l)) != s.end())
            continue;
        mn[i][j] = k;
        mn[i][k] = j;
        mn[j][k] = i;
        s.insert(make_pair(make_pair(i, j), k));
      }
    }
  }
  if (s.find(make_pair(make_pair(a[0], a[1]), a[2])) != s.end())
    cout << "BitAryo";
  else
    cout << "BitLGM";
}
