#include <bits/stdc++.h>
using namespace std;
int arr[309];
bool gameresult(int in, int ou) {
  int i, k = 0, d = 0;
  for (i = 1; i <= 300; i++) {
    arr[i] = 0;
  }
  for (i = 1; i <= in; i++) {
    if (arr[i] == 0) {
      d++;
      arr[i] = i + d;
      arr[i + d] = i;
    }
  }
  if (arr[in] == ou)
    return true;
  else
    return false;
}
int main() {
  int mimi, i, n;
  cin >> n;
  int ar[3];
  for (i = 0; i < n; i++) cin >> ar[i];
  if (n == 1) {
    if (ar[0] == 0)
      cout << "BitAryo";
    else
      cout << "BitLGM";
  } else if (n == 2) {
    if (min(ar[0], ar[1]) == 0) {
      if (max(ar[0], ar[1]) == 0)
        cout << "BitAryo";
      else
        cout << "BitLGM";
    } else if (min(ar[0], ar[1]) == 1) {
      if (max(ar[0], ar[1]) == 2)
        cout << "BitAryo";
      else
        cout << "BitLGM";
    } else if (min(ar[0], ar[1]) == 2)
      cout << "BitLGM";
    else {
      mimi = min(ar[0], ar[1]);
      ar[1] = max(ar[0], ar[1]);
      ar[0] = mimi;
      if (gameresult(ar[0], ar[1]))
        cout << "BitAryo";
      else
        cout << "BitLGM";
    }
  } else {
    if ((ar[0] ^ ar[1] ^ ar[2]) != 0)
      cout << "BitLGM";
    else
      cout << "BitAryo";
  }
}
