#include <bits/stdc++.h>
using namespace std;
int num[5];
int main() {
  int i, n, N;
  scanf("%d", &N);
  for (i = 1; i <= N; ++i) scanf("%d", &num[i]);
  if (N == 1) {
    if (num[1] != 0)
      printf("BitLGM");
    else
      printf("BitAryo");
  } else if (N == 2) {
    int a, b;
    a = num[1], b = num[2];
    double x = (1 + sqrt(5.0)) / 2;
    double y = (3 + sqrt(5.0)) / 2;
    if (a > b) swap(a, b);
    n = ceil(b / y);
    int big;
    big = n * y;
    int sm;
    sm = n * x;
    if (sm == a && big == b)
      printf("BitAryo");
    else
      printf("BitLGM");
  } else if (N == 3) {
    if ((num[1] ^ num[2] ^ num[3]) == 0)
      printf("BitAryo");
    else
      printf("BitLGM");
  }
  return 0;
}
