#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9;
const long long INFL = 2e18;
const int N = 300;
int a[4];
bool f[N][N];
void nBang2() {
  f[0][0] = 0;
  for (int i = (0), _b = (a[1]); i <= _b; ++i)
    for (int j = (0), _b = (a[2]); j <= _b; ++j) {
      if (i + j == 0) continue;
      for (int k = (0), _b = (i - 1); k <= _b; ++k) f[i][j] |= !f[k][j];
      for (int k = (0), _b = (j - 1); k <= _b; ++k) f[i][j] |= !f[i][k];
      for (int k = (1), _b = (min(i, j)); k <= _b; ++k)
        f[i][j] |= !f[i - k][j - k];
    }
  if (f[a[1]][a[2]])
    cout << "BitLGM" << '\n';
  else
    cout << "BitAryo" << '\n';
}
bool dp[N][N][N], g[3][N][N], t[2 * N + 5][2 * N + 5];
void nBang3() {
  t[0][0] = g[0][0][0] = g[1][0][0] = g[2][0][0] = 1;
  for (int i = (0), _b = (a[1]); i <= _b; ++i)
    for (int j = (0), _b = (a[2]); j <= _b; ++j)
      for (int k = (0), _b = (a[3]); k <= _b; ++k) {
        if (i + j + k == 0) continue;
        dp[i][j][k] = g[0][j][k] || g[1][i][k] || g[2][i][j];
        dp[i][j][k] |= t[(i - j + N)][(j - k + N)];
        g[0][j][k] |= !dp[i][j][k];
        g[1][i][k] |= !dp[i][j][k];
        g[2][i][j] |= !dp[i][j][k];
        t[(i - j + N)][(j - k + N)] |= !dp[i][j][k];
      }
  if (dp[a[1]][a[2]][a[3]])
    cout << "BitLGM" << '\n';
  else
    cout << "BitAryo" << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = (1), _b = (n); i <= _b; ++i) cin >> a[i];
  if (n == 1) {
    if (a[1] == 0)
      cout << "BitAryo" << '\n';
    else
      cout << "BitLGM" << '\n';
  } else if (n == 2)
    nBang2();
  else
    nBang3();
  return 0;
}
