#include <bits/stdc++.h>
using namespace std;
const int N = 310;
int n;
int a[10];
bool bad[N][N];
vector<pair<int, int> > b;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  if (n == 1) {
    if (a[0] == 0)
      puts("BitAryo");
    else
      puts("BitLGM");
    return 0;
  }
  if (n == 2) {
    bad[0][0] = true;
    bad[2][1] = true;
    b.push_back(make_pair(0, 0));
    b.push_back(make_pair(2, 1));
    for (int i = 1; i <= max(a[0], a[1]); i++)
      for (int j = 0; j <= i; j++) {
        bool ok = true;
        for (int k = 0; k < (int)b.size(); k++) {
          if (b[k].first == i && b[k].second < j) {
            ok = false;
            break;
          }
          if (b[k].second == j) {
            ok = false;
            break;
          }
          if (b[k].first == j && b[k].second < i) {
            ok = false;
            break;
          }
          if (b[k].first - b[k].second == i - j) {
            ok = false;
            break;
          }
        }
        if (ok) {
          bad[i][j] = true;
          b.push_back(make_pair(i, j));
        }
      }
    if (bad[max(a[0], a[1])][min(a[0], a[1])])
      puts("BitAryo");
    else
      puts("BitLGM");
  }
  if (n == 3) {
    if ((a[0] ^ a[1] ^ a[2]) != 0)
      puts("BitLGM");
    else
      puts("BitAryo");
  }
  return 0;
}
