#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-11;
int n, k;
int a[3];
bool b[401][401][401];
int main() {
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> a[i];
  if (n == 0)
    cout << "BitAryo";
  else if (n == 1) {
    if (a[0] == 0)
      cout << "BitAryo";
    else
      cout << "BitLGM";
  } else if (n == 2) {
    int first = 0, second = 0;
    bool b[400][400];
    memset(b, 0, sizeof(b));
    while (first <= 300) {
      while (b[first][second]) {
        second++;
        if (second > 300) {
          first++;
          second = first;
        }
      }
      for (int i = first + 1; i <= 300; i++) {
        b[i][second] = 1;
        b[second][i] = 1;
      }
      for (int i = second + 1; i <= 300; i++) {
        b[first][i] = 1;
        b[i][first] = 1;
      }
      for (int i = 1; i + first <= 300 && i + second <= 300; i++) {
        b[i + first][i + second] = 1;
        b[i + second][i + first] = 1;
      }
      second++;
      if (second > 300) {
        first++;
        second = first;
      }
    }
    if (!b[a[0]][a[1]])
      cout << "BitAryo";
    else
      cout << "BitLGM";
  } else {
    int first = 0, second = 0, z = 0;
    memset(b, 0, sizeof(b));
    while (first <= 300) {
      while (b[first][second][z]) {
        z++;
        if (z > 300) {
          second++;
          z = second;
        }
        if (second > 300) {
          first++;
          second = first;
          z = first;
        }
      }
      for (int i = first + 1; i <= 300; i++) {
        b[i][second][z] = 1;
        b[i][z][second] = 1;
        b[second][i][z] = 1;
        b[z][i][second] = 1;
        b[second][z][i] = 1;
        b[z][second][i] = 1;
      }
      for (int i = second + 1; i <= 300; i++) {
        b[i][first][z] = 1;
        b[i][z][first] = 1;
        b[first][i][z] = 1;
        b[z][i][first] = 1;
        b[first][z][i] = 1;
        b[z][first][i] = 1;
      }
      for (int i = z + 1; i <= 300; i++) {
        b[i][first][second] = 1;
        b[i][second][first] = 1;
        b[first][i][second] = 1;
        b[second][i][first] = 1;
        b[first][second][i] = 1;
        b[second][first][i] = 1;
      }
      for (int i = 1; i + first <= 300 && i + second <= 300 && i + z <= 300;
           i++)
        b[i][i][i] = 1;
      z++;
      if (z > 300) {
        second++;
        z = second;
      }
      if (second > 300) {
        first++;
        second = first;
        z = first;
      }
    }
    if (!(a[0] ^ a[1] ^ a[2]))
      cout << "BitAryo";
    else
      cout << "BitLGM";
  }
  return 0;
}
