#include <bits/stdc++.h>
using namespace std;
int dp[301][301];
int f(int x, int y) {
  if (dp[x][y]) return dp[x][y];
  for (int i = 1; i <= x; i++)
    if (f(x - i, y) == 2) return dp[x][y] = 1;
  for (int i = 1; i <= y; i++)
    if (f(x, y - i) == 2) return dp[x][y] = 1;
  for (int i = 1; i <= min(x, y); i++)
    if (f(x - i, y - i) == 2) return dp[x][y] = 1;
  return dp[x][y] = 2;
}
int main() {
  int n, a, b, c;
  scanf("%d", &n);
  if (n == 1) {
    scanf("%d", &a);
    if (a)
      printf("BitLGM\n");
    else
      printf("BitAryo\n");
  } else if (n == 3) {
    scanf("%d%d%d", &a, &b, &c);
    if (a ^ b ^ c)
      printf("BitLGM\n");
    else
      printf("BitAryo\n");
  } else {
    scanf("%d%d", &a, &b);
    if (f(a, b) == 1)
      printf("BitLGM\n");
    else
      printf("BitAryo\n");
  }
  return 0;
}
