#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a, b, c;
  scanf("%d", &n);
  if (n == 1) {
    cin >> a;
    if (a > 0)
      printf("BitLGM\n");
    else
      printf("BitAryo\n");
  } else if (n == 2) {
    cin >> a >> b;
    if (a == 0 && b == 0)
      printf("BitAryo\n");
    else {
      int mi = min(a, b);
      int mx = max(a, b);
      int k = ((mx - mi) * (sqrt(5.0) + 1) / 2);
      if (k == mi)
        printf("BitAryo\n");
      else
        printf("BitLGM\n");
    }
  } else if (n == 3) {
    cin >> a >> b >> c;
    int sum = 0;
    sum ^= a;
    sum ^= b;
    sum ^= c;
    if (sum)
      printf("BitLGM\n");
    else
      printf("BitAryo\n");
  }
  return 0;
}
