#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
vector<vector<bool> > dp, calced;
bool dfs(int a, int b) {
  if (a == 0 && b == 0) return false;
  if (a == 0 || b == 0) return true;
  if (calced[a][b]) return dp[a][b];
  calced[a][b] = true;
  bool flag = false;
  for (int i = 1; i <= a; i++) flag = flag | (!dfs(a - i, b));
  for (int i = 1; i <= b; i++) flag = flag | (!dfs(a, b - i));
  int mn = min(a, b);
  for (int i = 1; i <= mn; i++) flag = flag | (!dfs(a - i, b - i));
  return (dp[a][b] = flag);
}
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n == 1) {
    if (a[0] != 0)
      cout << "BitLGM";
    else
      cout << "BitAryo";
    return 0;
  }
  if (n == 2) {
    dp.resize(400, vector<bool>(400, false));
    calced = dp;
    if (dfs(a[0], a[1]))
      cout << "BitLGM";
    else
      cout << "BitAryo";
    return 0;
  }
  if (((a[0] ^ a[1]) ^ a[2]) != 0)
    cout << "BitLGM";
  else
    cout << "BitAryo";
  return 0;
}
