#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
int dp[307][307];
int solve(int x, int y) {
  if (dp[x][y] >= 0) return dp[x][y];
  for (int i = 1; i <= x; i++)
    if (solve(x - i, y) == 0) return dp[x][y] = 1;
  for (int i = 1; i <= y; i++)
    if (solve(x, y - i) == 0) return dp[x][y] = 1;
  int m = x < y ? x : y;
  for (int i = 1; i <= m; i++)
    if (solve(x - i, y - i) == 0) return dp[x][y] = 1;
  return dp[x][y] = 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  memset(dp, (-1), sizeof(dp));
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    a.push_back(val);
  }
  if (n == 1) {
    if (!a[0]) {
      cout << "BitAryo" << endl;
    } else {
      cout << "BitLGM" << endl;
    }
  } else if (n == 3) {
    if (a[0] ^ a[1] ^ a[2]) {
      cout << "BitLGM" << endl;
    } else {
      cout << "BitAryo" << endl;
    }
  } else {
    if (solve(a[0], a[1])) {
      cout << "BitLGM" << endl;
    } else {
      cout << "BitAryo" << endl;
    }
  }
  return 0;
}
