#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline std::ostream& operator<<(std::ostream& os, const std::pair<T1, T2>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
  bool first = true;
  os << "[";
  for (unsigned int i = 0; i < v.size(); i++) {
    if (!first) os << ", ";
    os << v[i];
    first = false;
  }
  return os << "]";
}
template <typename T>
inline std::ostream& operator<<(std::ostream& os, const std::set<T>& v) {
  bool first = true;
  os << "[";
  for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end();
       ++ii) {
    if (!first) os << ", ";
    os << *ii;
    first = false;
  }
  return os << "]";
}
template <typename T1, typename T2>
inline std::ostream& operator<<(std::ostream& os, const std::map<T1, T2>& v) {
  bool first = true;
  os << "[";
  for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end();
       ++ii) {
    if (!first) os << ", ";
    os << *ii;
    first = false;
  }
  return os << "]";
}
template <typename T, typename T2>
void printarray(T a[], T2 sz, T2 beg = 0) {
  for (T2 i = beg; i < beg + sz; i++) cout << a[i] << " ";
}
int arr[300][300][300];
int main() {
  int i, j;
  int n, m, k;
  scanf("%d", &n);
  int a = 0, b = 0, c = 0;
  scanf("%d", &a);
  if (n > 1) scanf("%d", &b);
  if (n > 2) scanf("%d", &c);
  if (n == 1) {
    if (a == 0)
      printf("%s\n", "BitAryo");
    else
      printf("%s\n", "BitLGM");
  } else if (n == 2) {
    int brr[300][300];
    for (i = 0; i < 300; i++)
      for (j = 0; j < 300; j++) {
        brr[i][j] = -1;
      }
    for (i = 0; i < 300; i++)
      for (j = 0; j < 300; j++) {
        if (brr[i][j] != -1) continue;
        brr[i][j] = 0;
        m = j;
        while (++m < 300) brr[i][m] = 1;
        m = i;
        while (++m < 300) brr[m][j] = 1;
        m = 1;
        while (i + m < 300 && j + m < 300) {
          brr[i + m][j + m] = 1;
          m++;
        }
      }
    if (brr[a][b] == 1)
      printf("%s\n", "BitLGM");
    else
      printf("%s\n", "BitAryo");
  } else {
    for (i = 0; i < 300; i++)
      for (j = 0; j < 300; j++)
        for (k = 0; k < 300; k++) {
          arr[i][j][k] = -1;
        }
    for (i = 0; i < 300; i++)
      for (j = 0; j < 300; j++)
        for (k = 0; k < 300; k++) {
          if (arr[i][j][k] != -1) continue;
          arr[i][j][k] = 0;
          m = k;
          while (++m < 300) arr[i][j][m] = 1;
          m = j;
          while (++m < 300) arr[i][m][k] = 1;
          m = i;
          while (++m < 300) arr[m][j][k] = 1;
          m = 1;
          while (i + m < 300 && j + m < 300 && k + m < 300) {
            arr[i + m][j + m][k + m] = 1;
            m++;
          }
        }
    if (arr[a][b][c] == 1)
      printf("%s\n", "BitLGM");
    else
      printf("%s\n", "BitAryo");
  }
  return 0;
nosol:
  printf("%d\n", -1);
  return 0;
}
