#include <bits/stdc++.h>
using namespace std;
int dp[330][330];
bool f(int a, int b) {
  if (a == 0 && b == 0) {
    return 0;
  }
  if (dp[a][b] != -1) return dp[a][b];
  bool z;
  for (int i = 1; i <= a; i++) {
    z = f(a - i, b);
    if (!z) return dp[a][b] = 1;
    if (i <= b) z = f(a - i, b - i);
    if (!z) return dp[a][b] = 1;
  }
  for (int i = 1; i <= b; i++) {
    z = f(a, b - i);
    if (!z) return dp[a][b] = 1;
    if (i <= a) z = f(a - i, b - i);
    if (!z) return dp[a][b] = 1;
  }
  return dp[a][b] = 0;
}
int main() {
  memset(dp, -1, sizeof(dp));
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int r = 0;
  for (int i = 0; i < n; i++) r = r ^ a[i];
  if (n == 3 || n == 1) {
    if (r == 0) {
      cout << "BitAryo";
    } else
      cout << "BitLGM";
  } else {
    if (f(a[0], a[1]))
      cout << "BitLGM";
    else
      cout << "BitAryo";
  }
  return 0;
}
