#include <bits/stdc++.h>
using namespace std;
int a[10];
int x[305] = {0}, y[305] = {0}, vis[666] = {0};
int main() {
  int n, i, k = 0, p = 0, q = 0, flag = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i <= 300; i++) {
    if (vis[i] == 0) {
      x[p] = i;
      y[q] = x[p] + k;
      k++;
      vis[x[p]] = 1, vis[y[q]] = 1;
      p++, q++;
    }
  }
  if (n == 1) {
    if (a[0] == 0)
      cout << "BitAryo" << endl;
    else
      cout << "BitLGM" << endl;
  } else if (n == 2) {
    if (a[0] > a[1]) swap(a[0], a[1]);
    for (i = 0; i <= p; i++) {
      if (a[0] == x[i] && a[1] == y[i]) {
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      cout << "BitAryo" << endl;
    else
      cout << "BitLGM" << endl;
  } else {
    if ((a[0] ^ a[1] ^ a[2]) == 0)
      cout << "BitAryo" << endl;
    else
      cout << "BitLGM" << endl;
  }
  return 0;
}
