Uses math;
var s,n,i,m,j,k,x:longint;
    a:array[0..3]of longint;
    dp:array[0..300,0..300]of longint;
 begin
  read(n);
  for i:=1 to n do
    read(a[i]);
  m:=300;
  if(n=1)then
   begin
    if(a[i]=0)then writeln('BitAryo')else
    writeln('BitLGM');
    exit;
   end;
  if(n=2)then
   begin
    for i:=0 to m do
     for j:=0 to m do
      begin
       if(i=0)and(j=0)then continue;
       for k:=1 to min(i,j) do
        if(dp[i-k][j-k]=0)then dp[i,j]:=1;
       for k:=1 to i do
        if(dp[i-k][j]=0)then dp[i,j]:=1;
       for k:=1 to j do
        if(dp[i][j-k]=0)then dp[i,j]:=1;
      end;
    if(dp[a[1],a[2]]=0)then write('BitAryo')
                       else write('BitLGM');
    exit;
   end;
  if(n=3)then
   begin
    s:=a[1] xor a[2] xor a[3];
    if(s>0)Then writeln('BitLGM')
           else writeln('BitAryo');
    exit;
   end;
 end.

{$Q-,R-,S-,I-,O+,L-,D-}
var f:array[0..300,0..300,0..300] of boolean;
    l,i,j,n,m,k:longint;
    a:array[1..3] of longint;
    fl:boolean;

    function ok(a,b:longint):boolean;
     begin
      if a<b then exit(f[a][b][0]) else exit(f[b][a][0]);
     end;

     function ok2(a,b,c:longint):boolean;
      var k:longint;
       begin
        if a>b then
         begin
          k:=a; a:=b; b:=k;
         end;
        if a>c then
         begin
          k:=a; a:=c; c:=k;
         end;
        if b>c then
         begin
          k:=b; b:=c; c:=k;
         end;
        exit(f[a][b][c]);
       end;

     begin
      readln(n);
      for i:=1 to n do read(a[i]);
      for i:=1 to n-1 do for j:=i to n do if a[i]>a[j] then
       begin
        k:=a[i]; a[i]:=a[j]; a[j]:=k;
       end;
      if n=1 then
       begin
        if a[1]=0 then writeln('BitAryo') else writeln('BitLGM');
        halt;
       end;
      f[0][0][0]:=false;
      if n=3 then
       begin

     if a[1] xor a[2] xor a[3] <> 0 then writeln('BitLGM') else writeln('BitAryo');
     halt;
    end;
    for i:=0 to a[1] do for j:=i to a[2] do if (i+j>0) then
     begin
      fl:=false;
      for l:=1 to i do if not ok(i-l,j) then
       begin
        fl:=true;
        break;
       end;
      if fl then
       begin
        f[i][j][0]:=true;
        continue;
       end;
      for l:=1 to j do if not ok(i,j-l) then
       begin
        fl:=true;
        break;
       end;
      if fl then
       begin
        f[i][j][0]:=true;
        continue;
       end;
      for l:=1 to i do if not f[i-l][j-l][0] then
       begin
        fl:=true;
        break;
       end;
      f[i][j][0]:=fl;
    end;
    if f[a[1]][a[2]][0] then writeln('BitLGM') else writeln('BitAryo');
end.

var n,i,j,k,l,ww,u,v,w:longint;
   a:array[0..3]of longint;
   f:array[0..300,0..300,0..300]of longint;
function min(a,b:longint):longint;
  begin
  if a<b then exit(a);
  exit(b);
  end;
begin
  readln(n);

  for i:=1 to n do
  read(a[i]);
  if a[1]+a[2]+a[3]<>0 then
  for i:=0 to a[1] do
  for j:=0 to a[2] do
  for k:=0 to a[3] do
  if f[i,j,k]=0 then
  begin
  ww:=maxlongint;
  if (n>=1) then ww:=min(ww,a[1]-i);
  if (n>=2) then ww:=min(ww,a[2]-j);
  if (n>=3) then ww:=min(ww,a[3]-k);
  for l:=1 to a[1]-i do
  f[i+l,j,k]:=1;
  for l:=1to a[2]-j do
  f[i,j+l,k]:=1;
  for l:=1 to a[3]-k do
  f[i,j,k+l]:=1;
  for l:=1 to ww do
  begin
  u:=0;v:=0;w:=0;
  if n>=1 then u:=i+l;
  if n>=2 then v:=j+l;
  if n>=3 then w:=k+l;
  f[u,v,w]:=1;
  end;
  end;
  if f[a[1],a[2],a[3]]=1 then
  writeln('BitLGM')
  else
  writeln('BitAryo');

end.

uses math;
const win :string ='BitLGM';
     lose :string ='BitAryo';
type pair =record
  a :longint;
  b :longint;
end;
var n,m,i,j,t,ans,a,b,c,k  :longint;
    d :Array[0..310,0..310] of boolean;
    fl :boolean;
Procedure swap(var a,b :longint);
var t :longint; Begin t:=a; a:=b; b:=t; end;
Begin
  read(n);
  if n=1 then
  Begin
    read(t);
    if t>0 then writeln(win) else writeln(lose);
    halt;
  end;
  if n=2 then
  Begin
    d[0,0]:=true;
    read(a,b);
    if a>b then swap(a,b);
    for i:=1 to a do
     for j:=1 to b do
     Begin
       fl:=false;
       for k:=0 to 300 do
       Begin
         if (min(i,j)>=k)and(d[i-k,j-k]) then fl:=true;
         if (i>=k)       and(d[i-k,j])   then fl:=true;
         if (j>=k)       and(d[i,j-k])   then fl:=true;
       end;
       d[i,j]:=not fl;
     end;
    if d[a,b] then writeln(lose)else writeln(win);
  end else
  Begin
    read(a,b,c);
    if(a xor b xor c)=0then writeln(lose)else writeln(win);
  end;
end.

{$r-, s-, q-, i-, o+}
uses math;
var
  n, i, j, k : longint;
  a : array [0..400] of longint;
  f : array [0..400, 0..400] of longint;
begin
  readln(n);
  for i := 1 to n do read(a[i]);
  if (n = 1) then
    begin
      if (a[n] > 0) then writeln('BitLGM') else
                         writeln('BitAryo');
    end else
      if (n = 2) then
        begin
          for i := 0 to a[1] do
            for j := 0 to a[2] do
              for k := 1 to max(i, j) do
                if ((k <= i) and (f[i - k][j] = 0)) or
                   ((k <= j) and (f[i][j - k] = 0)) or
                   ((k <= i) and (k <= j) and (f[i - k][j - k] = 0)) then
                     begin
                       f[i][j] := 1;
                       break;
                     end;
          if (f[a[1]][a[2]] = 1) then writeln('BitLGM') else
                                      writeln('BitAryo');
        end else
          begin
            if (a[1] xor a[2] xor a[3] > 0) then writeln('BitLGM') else
                                                 writeln('BitAryo');
          end;
end.

program p1;
uses math;
var n,i,j,k,x:integer;
a:array[0..3] of integer;
win:array[0..300,0..300] of integer;
begin
        readln(n);
        for i:=1 to n do read(a[i]);
        if (a[i]=0) and (n=1) then
        begin
                writeln('BitAryo');
                halt(0);
        end;
        if (a[i]>0) and (n=1) then
        begin
                writeln('BitLGM');
                halt(0);
        end;

        if n=3 then
        begin
                x:=a[1] xor a[2] xor a[3];
                if x>0 then writeln('BitLGM')
                else writeln('BitAryo');
                halt(0);
        end;

        if n=2 then
        begin
                for i:=0 to a[1] do
                for j:=0 to a[2] do
                for k:=1 to max(i,j)do
                if ((k<=i) and (win[i-k][j]=0)) or
                        ((k<=j) and (win[i][j-k]=0)) or
                        ((k<=i) and (k<=j) and (win[i-k][j-k]=0))
                        then begin
                                win[i][j]:=1;
                                break;
                        end;
                if (win[a[1]][a[2]]=1) then writeln('BitLGM')
                else writeln('BitAryo');
        end;
end.

uses
  math;

const
  Fir='BitLGM';
  Sec='BitAryo';

var
  f:array[0..333,0..333]of longint;
  n,m,k,i,j:longint;

begin
  read(n);
  if (n=1)then begin
    read(n);
    if (n>0)then writeln(Fir)else writeln(Sec);
  end else
  if (n=3)then begin
    read(n,m,k);
    n:=n xor m xor k;
    if (n>0)then writeln(Fir)else writeln(Sec);
  end else begin
    read(n,m);
    for i:=0 to n do
      for j:=0 to m do
        for k:=1 to max(i,j)do
          if ((k<=i)and(f[i-k][j]=0))or
              ((k<=j)and(f[i][j-k]=0))or
              ((k<=i)and(k<=j)and(f[i-k][j-k]=0))
                then begin f[i][j]:=1;break; end;
    if (f[n][m]=1)then writeln(Fir)else writeln(Sec);
  end;
end.

uses math;
var
  a:array[1..3] of longint;
  i,j,n:longint;
  first,second:string;
  f,find:array[0..300,0..300] of boolean;

procedure print(s : string);
begin
  writeln(s);
  halt;
end;

function f_2(a,b:longint) : boolean;
var
  x,y,i:longint;
  can:boolean;
begin
  x:=min(a,b);
  y:=max(a,b);
  if find[x,y] then exit(f[x,y]);
  if (x = 0) then if y <> 0 then exit(true) else exit(false);
  if (x = y) then exit(true);
  can:=false;
  for i:=1 to x do if not(f_2(x - i,y-i)) then can:=true;
  for i:=1 to x do if not(f_2(x-i,y)) then can := true;
  for i:=1 to y do if not(f_2(x,y-i)) then can := true;
  find[x,y] := true;
  f[x,y] := can;
  f_2 := can;
end;

procedure swap(var a,b:longint);
var
  c:longint;
begin
  c:=a;
  a:=b;
  b:=c;
end;

begin
  readln(n);
  for i:=1 to n do read(a[i]);
  for i:=0 to 300 do
    for j:=0 to 300 do find[i,j] := false;
  for i:=0 to 300 do
    for j:=0 to 300 do f[i,j] := false;
  for i:=1 to 300 do f[0,i] := true;
  for i:=1 to 300 do f[i,0] := true;
  for i:=3 to 300 do f[1,i] := true;
  f[1,1] := true;
  f[1,2] := false;
  for i:=1 to 300 do find[0,i] := true;
  for i:=1 to 300 do find[i,0] := true;
  for i:=3 to 300 do find[1,i] := true;
  find[1,1] := true;
  find[1,2] := true;
  first:='BitLGM';
  second:='BitAryo';
  if n = 1 then if a[1] = 0 then print(second) else print(first);
  if n = 2 then if f_2(a[1],a[2]) then print(first) else print(second);
  for i:=1 to 2 do
    for j:=i+1 to 3 do if a[i] > a[j] then swap(a[i],a[j]);
  if (a[1] xor a[2] xor a[3] = 0 ) then print(SECOND) else print(first);
end.

uses math; const first='BitLGM'; second='BitAryo';
var
    f:array[0..300,0..300] of byte; n,i,j,k,a,b,c:longint;

begin

  readln(n);
  if n=1 then
    begin
      readln(a);
      if a=0 then writeln(second) else writeln(first);
    end;
  if n=2 then
    begin
      readln(a,b);
      for i:=0 to a do
        for j:=0 to b do
        begin
          for k:=1 to min(i,j) do if f[i-k,j-k]=0 then f[i,j]:=1;
          for k:=1 to max(i,j) do
            if ((i-k>=0)and(f[i-k,j]=0)) or ((j-k>=0)and(f[i,j-k]=0)) then f[i,j]:=1;
        end;
      if f[a,b]=0 then writeln(second) else writeln(first);
    end;
  if n=3 then
    begin
      readln(a,b,c);
      if (a xor b xor c)=0 then writeln(second) else writeln(first);
    end;

end.

uses math;
var
  a:array[1..3] of longint;
  i,j,n:longint;
  first,second:string;
  f,find:array[0..300,0..300] of boolean;

procedure print(s : string);
begin
  writeln(s);
  halt;
end;

function f_2(a,b:longint) : boolean;
var
  x,y,i:longint;
  can:boolean;
begin
  x:=min(a,b);
  y:=max(a,b);
  if find[x,y] then exit(f[x,y]);
  if (x = 0) then if y <> 0 then exit(true) else exit(false);
  if (x = y) then exit(true);
  can:=false;
  for i:=1 to x do if not(f_2(x - i,y-i)) then can:=true;
  for i:=1 to x do if not(f_2(x-i,y)) then can := true;
  for i:=1 to y do if not(f_2(x,y-i)) then can := true;
  find[x,y] := true;
  f[x,y] := can;
  f_2 := can;
end;

procedure swap(var a,b:longint);
var
  c:longint;
begin
  c:=a;
  a:=b;
  b:=c;
end;

begin
  readln(n);
  for i:=1 to n do read(a[i]);
  for i:=0 to 300 do
    for j:=0 to 300 do find[i,j] := false;
  for i:=0 to 300 do
    for j:=0 to 300 do f[i,j] := false;
  for i:=1 to 300 do f[0,i] := true;
  for i:=1 to 300 do f[i,0] := true;
  for i:=3 to 300 do f[1,i] := true;
  f[1,1] := true;
  f[1,2] := false;
  for i:=1 to 300 do find[0,i] := true;
  for i:=1 to 300 do find[i,0] := true;
  for i:=3 to 300 do find[1,i] := true;
  find[1,1] := true;
  find[1,2] := true;
  first:='BitLGM';
  second:='BitAryo';
  if n = 1 then if a[1] = 0 then print(second) else print(first);
  if n = 2 then if f_2(a[1],a[2]) then print(first) else print(second);
  for i:=1 to 2 do
    for j:=i+1 to 3 do if a[i] > a[j] then swap(a[i],a[j]);
  if a[1] = 0 then if (a[2] <> a[3]) and f_2(a[2],a[3])
  then print(first) else print(second);
  if (a[1] = a[2]) and (a[1] = a[3]) then print(first);
  if (a[1] xor a[2] xor a[3] = 0 ) then print(SECOND) else print(first);
end.

{$r-,s-,q-,i-,o+}
{$M 10000000}
var
  f:array [0..300,0..300] of byte;
  a:array [0..100] of longint;
  n,i,j,k:longint;
  function min(a,b:longint):longint; begin if a<b then min:=a else min:=b; end;
  function max(a,b:longint):longint; begin if a>b then max:=a else max:=b; end;

  function rec(x,y:longint):longint;
    var
      ans:byte;
      i,kol,ko:longint;
    begin
      if f[x,y]<>2 then begin rec:=f[x,y]; exit; end;
      if (x=0) and (y=0) then begin rec:=0; exit; end;
      if ((x=0) and (y>0)) or ((x>0) and (y=0)) then begin rec:=1; exit; end;
      ko:=0;
      for i:=1 to min(x,y) do
        if rec(x-i,y-i)=0 then inc(ko);
      for i:=1 to max(x,y) do
        begin
          if (x>=i) and (rec(x-i,y)=0) then inc(ko);
          if (y>=i) and (rec(x,y-i)=0) then inc(ko);
        end;
      if ko>0 then ans:=1 else ans:=0;
      f[x,y]:=ans;
      rec:=ans;
    end;

begin
  randomize;
  readln(n);
  for i:=1 to n do read(a[i]);
  if n=1 then begin if a[1]>0 then writeln('BitLGM') else writeln('BitAryo'); halt(0); end;
  if n=3 then begin if a[1] xor a[2] xor a[3]<>0 then writeln('BitLGM') else writeln('BitAryo'); halt(0); end;
  if n=2 then begin
  for i:=0 to 300 do
    for j:=0 to 300 do
        f[i,j]:=2;
  if rec(a[1],a[2])=1
    then writeln('BitLGM')
    else writeln('BitAryo'); end;
end.

Uses math;
Var a:array[0..301,0..301,0..301] of integer;
    n,i,j,k,ii,jj,kk:longint;
Procedure fill(iii,jjj,kkk:longint);
Var i,j,t,k:longint;
Begin
     a[iii,jjj,kkk]:=1;

     For i:=iii+1 to ii do a[i,jjj,kkk]:=2;
     For j:=jjj+1 to jj do a[iii,j,kkk]:=2;
     For k:=kkk+1 to kk do a[iii,jjj,k]:=2;

     For t:=1 to min(ii-iii,jj-jjj) do a[iii+t,jjj+t,kkk]:=2;

     For t:=1 to min(ii-iii,kk-kkk) do a[iii+t,jjj,kkk+t]:=2;

     For t:=1 to min(jj-jjj,kk-kkk) do a[iii,jjj+t,kkk+t]:=2;

     For t:=1 to min(ii-iii,min(jj-jjj,kk-kkk)) do a[iii+t,jjj+t,kkk+t]:=2;

     if a[ii,jj,kk]=2 then begin WRiteln('BitLGM'); halt end;
     if a[ii,jj,kk]=1 then begin WRiteln('BitAryo'); halt end;

End;

Begin
     Readln(n);
     if n=1 then begin Readln(ii);
      if ii=0 then writeln('BitAryo') else WRiteln('BitLGM');
      halt
     end;
     if n=2 then begin Readln(ii,jj); kk:=0 end;
     if n=3 then begin
      Readln(ii,jj,kk);
      if (ii xor jj) xor kk=0 then
       writeln('BitAryo') else WRiteln('BitLGM');
       halt
     end;

     For i:=0 to ii do
      For j:=0 to jj do
       For k:=0 to kk do
        if a[i,j,k]=0 then fill(i,j,k);

  End.

uses math;
var
  a:array[0..1000,0..1000]of longint;
  n,m,k,i,j:longint;

begin
  read(n);
  if (n=1)then begin
    read(n);
    if (n>0)then writeln('BitLGM')else writeln('BitAryo');
  end else
  if (n=3)then begin
    read(n,m,k);
    n:=n xor m xor k;
    if (n>0)then writeln('BitLGM')else writeln('BitAryo');
  end else begin
    read(n,m);
    for i:=0 to n do
      for j:=0 to m do
        for k:=1 to max(i,j)do
          if ((k<=i)and(a[i-k][j]=0))or
              ((k<=j)and(a[i][j-k]=0))or
              ((k<=i)and(k<=j)and(a[i-k][j-k]=0))
                then begin a[i][j]:=1;break; end;
    if (a[n][m]=1)then writeln('BitLGM')else writeln('BitAryo');
  end;
end.

var k,n,i,x,y,z:integer;
a,b,c:array [0..600] of integer;
begin
readln(n);
if n=1 then
  begin
  readln(x);
  if x=0 then writeln('BitAryo') else writeln('BitLGM');
  end;
if n=3 then
  begin
  readln(x,y,z);
  k:=(x xor y) xor z;
  if k=0 then writeln('BitAryo') else writeln('BitLGM');
  end;
if n=2 then
  begin
  readln(x,y);
  if x>y then
    begin
    z:=x;
    x:=y;
    y:=z;
    end;
  for i:=0 to 600 do a[i]:=0;
  k:=0;
  for i:=0 to 300 do
    begin
    if a[i]=0 then
      begin
      b[k]:=i;
      c[k]:=i+k;
      a[i]:=1;
      a[i+k]:=1;
      k+=1;
      end;
    end;
  k-=1;
  z:=0;
  for i:=0 to k do
    begin
    if (x=b[i]) and (y=c[i]) then
      begin
      z:=1;
      break;
      end;
    end;
  if z=0 then writeln('BitLGM') else writeln('BitAryo');
  end;
end.

program cf173d;
var
  a : array [0..299, 0..299, 0..299] of integer;
  b : array [0..299, 0..299] of integer;
  i, j, k, u, m, n, s, x, y, z : longint;
begin
readln(n);
if n = 1 then
  begin
    s := 1;
    readln(x);
    if x = 0 then
      s := 2;
  end;
if n = 2 then
  begin
    for i := 0 to 299 do
      for j := 0 to 299 do
        b[i, j] := 0;
    for i := 0 to 299 do
      for j := 0 to 299 do
       begin
         if b[i, j] = 0 then
           begin
             if i > j then
               m := i
             else
               m := j;
             m := 299 - m;
             for u := 1 to m do
               b[i + u, j + u] := 1;
             u := i + 1;
             while (u <= 299) do
               begin
                 b[u, j] := 1;
                 inc(u);
               end;
             u := j + 1;
             while (u <= 299) do
               begin
                 b[i, u] := 1;
                 inc(u);
               end;
             b[i, j] := 2;
           end;
       end;
    readln(x, y);
    s := b[x, y];
  end;
if n = 3 then
  begin
    for i := 0 to 299 do
      for j := 0 to 299 do
        for k := 0 to 299 do
          a[i, j, k] := 0;
    a[0, 0, 0] := 2;
    for i := 0 to 299 do
      for j := 0 to 299 do
        for k := 0 to 299 do
          begin
            if a[i, j, k] = 0 then
              a[i, j, k] := 2;
            if a[i, j, k] = 2 then
              begin
                u := i + 1;
                while (u <= 299) do
                  begin
                    a[u, j, k] := 1;
                    inc(u);
                  end;
                u := j + 1;
                while (u <= 299) do
                  begin
                    a[i, u, k] := 1;
                    inc(u);
                  end;
                u := k + 1;
                while (u <= 299) do
                  begin
                    a[i, j, u] := 1;
                    inc(u);
                  end;
                m := i;
                if j > m then
                  m := j;
                if k > m then
                  m := k;
                m := 299 - m;
                for u := 1 to m do
                  a[i + u, j + u, k + u] := 1;
              end;
          end;
      readln(x, y, z);
      s := a[x, y, z];
  end;
if s = 1 then
  writeln('BitLGM')
else
  writeln('BitAryo');
end.

var f2:array[0..301,0..301] of longint;
    f3:array[0..301,0..301,0..301] of longint;
    maxx:array[0..333,0..333] of longint;
    minn:array[0..333,0..333] of longint;
    n,m,i,j,k,q1,q2,q3:longint;
    a:array[0..40] of longint;
    first,second:string;

function min(a,b:longint):longint;
begin
 if a<b then min:=a else min:=b;
end;

function max(a,b:longint):longint;
begin
 if a>B then max:=a else max:=b;
end;

procedure two;
var i,j,k:longint;
begin
 for i:= 0 to 300 do
  for j:= 0 to 300 do
   begin
    if (i=0) and (j=0) then f2[i][j]:=0 else
    begin
     for k:= 1 to maxx[i,j] do
     begin
      if (i>=k) and (j>=k) and (f2[i-k][j-k] = 0) then f2[i][j]:=1;
      if (i>=k) and (f2[i-k][j] = 0) then f2[i][j]:=1;
      if (j>=k) and (f2[i][j-k] = 0) then f2[i][j]:=1;
     end;
    end;
   end;
end;

procedure swap(var t,y:longint);
var u:longint;
begin
 u:=t; t:=y; y:=u;
end;

begin
 first:='BitLGM';
 second:='BitAryo';
 readln(n);
 for i:= 1 to n do read(a[i]);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   maxx[i][j]:=max(i,j);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   minn[i][j]:=min(i,j);
 if n = 1 then
  begin
   if a[1]=0 then writeln(second) else writeln(first);
   halt;
  end;
 two;
 if n = 2 then
  begin
   if f2[a[1],a[2]]=1 then writeln(first) else writeln(second);
   halt;
  end;
 if a[1]>a[2] then swap(a[1],a[2]);
 if a[2]>a[3] then swap(a[2],a[3]);
 if a[1]>a[2] then swap(a[1],a[2]);
 {for i:= 0 to 300 do
  for j:= 0 to 300 do
   for k:= 0 to 300 do
    begin
     q1:=i;  q2:=j; q3:=k;
     if (q1>q2) then swap(q1,q2);
     if (Q2>q3) then swap(q2,q3);
     if (q1>q2) then swap(q1,q2);
     l1[i,j,k]:=q1;
     l2[i,j,k]:=q2;
     l3[i,j,k]:=q3;
    end;}
// three;
 f3[a[1],a[2],a[3]]:=a[1] xor a[2] xor a[3];
 if f3[a[1],a[2],a[3]]>0 then writeln(first) else writeln(second);
end.

uses math;
var
s1,s2:string;
dp:array[0..301,0..301]of longint;
st,m,t,n,i:longint;
b,a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x<0)or(y<0) then exit(true);
 if (x=0)and(y=0) then exit(false);
 if (x=y)and(n=2) then exit(true);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
      if (n=2)and(win(x-u,y-u)=false) then tmp:=true;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  s1:='BitLGM';
  s2:='BitAryo';
  for i:=1 to n do
   read(a[i]);
  if n=1 then
   begin
    if a[1]>0 then writeln(s1)
    else writeln(s2);
   end
  else
   begin
    if n=2 then
     begin
      if win(a[1],a[2]) then writeln(s1)
      else writeln(s2);
     end

    else
     begin
       t:=0;
       for i:=1 to n do
        if a[i]>0 then
         begin
          inc(t);
          b[t]:=a[i];
         end;
       if t=1 then writeln(s1)
       else if t=3 then
        begin
           b[1]:=b[1] xor b[2] xor b[3];
           if b[1]=0 then writeln(s2)
           else writeln(s1);
        end
       else
        begin
         if win(b[1],b[2]) then writeln(s1)
         else writeln(s2);
        end;
     end;
   end;
 end.

Uses math;
//const zz:array [1..3,1..11785] of longint=();
Var m:array [0..300,0..300] of boolean;
zz:array[1..300] of longint;
rez:array [1..10000] of Boolean;
m1:array [0..300,0..300,0..300] of boolean;
used:array [0..300,0..300,0..300] of Boolean;
c,i1,kol,n,z,a,b,i,j:LongInt;
f:boolean;
procedure swap(var a,b:longint);
var x:longint;
begin
  x:=a; a:=b; b:=x;
end;
function probeg2(a,b,c:longint):boolean;
Var i:longint;
begin
  if used[a,b,c]
  then begin probeg2:=m1[a,b,c]; Exit; end;
  used[a,b,c]:=true;
  used[b,c,a]:=true;
  used[a,c,b]:=true;
  used[b,a,c]:=True;
  used[c,a,b]:=true;
  used[c,b,a]:=true;
  m1[a,b,c]:=False;
  for i:=min(a,Min(b,c)) downto 1 do
  if not probeg2(a-i,b-i,c-i)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;

  for i:=a downto 1 do
  if not probeg2(a-i,b,c)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  for i:=b downto 1 do
  if not probeg2(a,b-i,c)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  for i:=c downto 1 do
  if not probeg2(a,b,c-i)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  probeg2:=false;
end;
procedure probeg(a,b:longint);
begin
        if (a=0)and(b=0)
        then begin writeln('BitAryo'); Halt(0); end;
        if (a=0)or(b=0)
        then begin writeln('BitLGM'); Halt(0); end;
        if a=b
        then begin writeln('BitLGM'); Halt(0); end;
        kol:=0;
        FillChar(m,SizeOf(m),true);
        for i:=1 to 300 do
        begin
          if not rez[i]
          then begin
                Inc(kol);
                if i+kol>300
                then Break;
                m[i,i+kol]:=false;
                m[i+kol,i]:=false;
                rez[i]:=true;
                rez[i+kol]:=true;
               end;
        end;
        if not m[a,b]
        then writeln('BitAryo')
        else Writeln('BitLGM');
  Halt(0);
end;
function stepen(x:longint):boolean;
begin
  while x>1 do
  begin
    if x mod 2=1
    then begin stepen:=false; exit; end;
    x:=x div 2;
  end;
  stepen:=true;
end;
procedure zapoln(a,b,c:longint);
begin
  m1[a,b,c]:=true; used[a,b,c]:=true;
{  m1[b,c,a]:=true; used[b,c,a]:=true;
  m1[a,c,b]:=true; used[a,c,b]:=true;
  m1[b,a,c]:=true; used[b,a,c]:=True;
  m1[c,a,b]:=true; used[c,a,b]:=true;
  m1[c,b,a]:=true; used[c,b,a]:=true;}
end;
begin
//Assign(input,'input.txt'); reset(input);
//Assign(output,'output.txt'); rewrite(output);
  readln(n);
  if n=1
  then begin
        read(a);
        if a<>0
        then writeln('BitLGM')
        else writeln('BitAryo');
         Halt(0);
       end;
  if n=2
  then begin
        Readln(a,b);
        if (a=0)and(b=0)
        then begin writeln('BitAryo'); Halt(0); end;
        if (a=0)or(b=0)
        then begin writeln('BitLGM'); Halt(0); end;
        if a=b
        then begin writeln('BitLGM'); Halt(0); end;
        kol:=0;
        FillChar(m,SizeOf(m),true);
        for i:=1 to 300 do
        begin
          if not rez[i]
          then begin
                Inc(kol);
                if i+kol>300
                then Break;
                m[i,i+kol]:=false;
                m[i+kol,i]:=false;
                rez[i]:=true;
                rez[i+kol]:=true;
               end;
        end;
        if not m[a,b]
        then writeln('BitAryo')
        else Writeln('BitLGM');
       end
  else begin
        readln(a,b,c);
        {if c=0
        then probeg(a,b);
        if b=0
        then probeg(a,c);
        if a=0
        then probeg(b,c);}
        for i:=0 to 300 do
        for j:=0 to 300 do
        for i1:=0 to 300 do
        begin
         if not used[i,j,i1]
         then begin
                m1[i,j,i1]:=False;
                used[i,j,i1]:=true;
                      for z:=300-Max(i,Max(j,i1)) downto 1 do
                      zapoln(i+z,j+z,i1+z);
                      for z:=i+1 to 300 do
                      zapoln(z,j,i1);
                      for z:=j+1 to 300 do
                      zapoln(i,z,i1);
                      for z:=i1+1 to 300 do
                      zapoln(i,j,z);
              end;
        end;
        if not m1[a,b,c]
        then writeln('BitAryo')
        else Writeln('BitLGM');
{        m1[0,0,0]:=false;
        for i:=0 to a do
        for j:=0 to b do
        for i1:=0 to c do
        begin
          f:=false;
          for z:=1 to min(i,min(j,i1)) do
          if not m1[i-z,j-z,i1-z]
          then f:=true;
          for z:=1 to i do
          if not m1[i-z,j,i1]
          then f:=true;
          for z:=1 to j do
          if not m1[i,j-z,i1]
          then f:=true;
          for z:=1 to i1 do
          if not m1[i,j,i1-z]
          then f:=true;
          m1[i,j,i1]:=f;
        end;
        for i:=1 to a do
        begin
          f:=false;
          for j:=i to b do
          for i1:=j to c do
          if not m1[i,j,i1]
          then writeln(i,' ',j,' ',i1,',');
        end;}
       end;
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  Math;

var
  a3, was3 : array[0..300, 0..300, 0..300] of boolean;
  a2, was2 : array[0..300, 0..300] of boolean;
  i, n : integer;
  y : array[1..3] of integer;

procedure first;
begin
  writeln('BitLGM');
  halt(0);
end;

procedure second;
begin
  writeln('BitAryo');
end;

function solve2(x, y : integer) : boolean;
var
  i : integer;
begin
  if was2[x, y] then
    result := a2[x, y]
  else begin
    was2[x, y] := true;
    result := false;
    for i := 1 to x do
      result := result or (not solve2(x - i, y));
    for i := 1 to y do
      result := result or (not solve2(x, y - i));
    for i := 1 to min(x, y) do
      result := result or (not solve2(x - i, y - i));
    a2[x, y] := result;
  end;
end;

function solve3(x, y, z : integer) : boolean;
var
  i : integer;
begin
  if was3[x, y, z] then
    result := a3[x, y, z]
  else begin
    was3[x, y, z] := true;
    result := false;
    for i := 1 to x do
      result := result or (not solve3(x - i, y, z));
    for i := 1 to y do
      result := result or (not solve3(x, y - i, z));
    for i := 1 to z do
      result := result or (not solve3(x, y, z - i));
    for i := 1 to min(x, min(y, z)) do
      result := result or (not solve3(x - i, y - i, z - i));
    a3[x, y, z] := result;
  end;
end;

begin
  readln(n);
  for i := 1 to n do
    read(y[i]);
  if (n = 1) then
    if (y[1] = 0) then
      second
    else
      first;
  if (n = 2) then
    if solve2(y[1], y[2]) then
      first
    else
      second;
  if (n = 3) then
    if (y[1] xor y[2] xor y[3] > 0) then
      first
    else
      second;
end.

{$R+,Q+,I+}
{$apptype console}
Uses SysUtils,math;
Type
   t_type=-1..1;
   t_type1=0..500;
Var
   dp:Array[0..300,0..300,0..300] of t_type;
   r:Array[0..300,0..300,0..300,1..4] of t_type1;
   a:Array[1..3] of Integer;
   n,i,j,k:Integer;
Procedure Solve(x,y,z:Integer);
Var t,k1,k2,k3,k4:Integer;
Begin
   If dp[x,y,z]<>-1 Then Exit;
   If n=2 Then Begin
      If x>0 Then Solve(x-1,y,z);
      If y>0 Then Solve(x,y-1,z);
      t:=min(x,y);
      If t>0 Then Solve(x-1,y-1,z);
      k1:=0;
      If x>0 Then k1:=r[x-1,y,z,1];
      k2:=0;
      If y>0 Then k2:=r[x,y-1,z,2];
      k3:=0;
      If t>0 Then k3:=r[x-1,y-1,z,4];
      If (k1=x) and (k2=y) and (k3=t) Then Begin
         dp[x,y,z]:=0;
         If x>0 Then r[x,y,z,1]:=r[x-1,y,z,1]
                Else r[x,y,z,1]:=0;
         If y>0 Then r[x,y,z,2]:=r[x,y-1,z,2]
                Else r[x,y,z,2]:=0;
         If t>0 Then r[x,y,z,4]:=r[x-1,y-1,z,4]
                Else r[x,y,z,4]:=0;
      End
      Else Begin
         dp[x,y,z]:=1;
         If x>0 Then r[x,y,z,1]:=r[x-1,y,z,1]+1
                Else r[x,y,z,1]:=1;
         If y>0 Then r[x,y,z,2]:=r[x,y-1,z,2]+1
                Else r[x,y,z,2]:=1;
         If t>0 Then r[x,y,z,4]:=r[x-1,y-1,z,4]+1
                Else r[x,y,z,4]:=1;
      End;
   End
   Else Begin
      If x>0 Then Solve(x-1,y,z);
      If y>0 Then Solve(x,y-1,z);
      If z>0 Then Solve(x,y,z-1);
      t:=min(x,min(y,z));
      If t>0 Then Solve(x-1,y-1,z-1);
      k1:=0;
      If x>0 Then k1:=r[x-1,y,z,1];
      k2:=0;
      If y>0 Then k2:=r[x,y-1,z,2];
      k3:=0;
      If z>0 Then k3:=r[x,y,z-1,3];
      k4:=0;
      If t>0 Then k4:=r[x-1,y-1,z-1,4];
      If (k1=x) and (k2=y) and (k3=z) and (k4=t) Then Begin
         dp[x,y,z]:=0;
         If x>0 Then r[x,y,z,1]:=r[x-1,y,z,1]
                Else r[x,y,z,1]:=0;
         If y>0 Then r[x,y,z,2]:=r[x,y-1,z,2]
                Else r[x,y,z,2]:=0;
         If z>0 Then r[x,y,z,3]:=r[x,y,z-1,3]
                Else r[x,y,z,3]:=0;
         If t>0 Then r[x,y,z,4]:=r[x-1,y-1,z-1,4]
                Else r[x,y,z,4]:=0;
      End
      Else Begin
         dp[x,y,z]:=1;
         If x>0 Then r[x,y,z,1]:=r[x-1,y,z,1]+1
                Else r[x,y,z,1]:=1;
         If y>0 Then r[x,y,z,2]:=r[x,y-1,z,2]+1
                Else r[x,y,z,2]:=1;
         If z>0 Then r[x,y,z,3]:=r[x,y,z-1,3]+1
                Else r[x,y,z,3]:=1;
         If t>0 Then r[x,y,z,4]:=r[x-1,y-1,z-1,4]+1
                Else r[x,y,z,4]:=1;
      End;
   End;
End;
Begin
   Read(n);
   For i:=1 To n Do Read(a[i]);
   If n=1 Then Begin
      If a[1]>0 Then Write('BitLGM')
                Else Write('BitAryo');
      Halt;
   End;
   If n=3 Then Begin
      If a[1] xor a[2] xor a[3]<>0 Then Write('BitLGM')
                                   Else Write('BitAryo');
      Halt;
   End;
   For i:=0 To 300 Do
      For j:=0 To 300 Do
         For k:=0 To 300 Do dp[i,j,k]:=-1;
   dp[0,0,0]:=0;
   Solve(a[1],a[2],a[3]);
   If dp[a[1],a[2],a[3]]=1 Then Write('BitLGM')
                           Else Write('BitAryo');
End.

program Project2;

{$APPTYPE CONSOLE}
{$R-,Q-,O+}

uses
  SysUtils, Math;

var
  i, j, k, n: integer;
  a: array[1..100] of integer;
  f: array[0..300, 0..300, 0..300] of integer;

function get(x1, x2, x3: integer): integer;
var
  i: integer;
  mex: array[0..1] of boolean;
begin
  for i := 0 to 1 do
    mex[i] := false;

  if (f[x1][x2][x3] = -1) then begin
    for i := 1 to x1 do begin
      if (mex[0]) then
        break;
      mex[get(x1 - i, x2, x3)] := true;
    end;

    for i := 1 to x2 do begin
      if (mex[0]) then
        break;
      mex[get(x1, x2 - i, x3)] := true;
    end;

    for i := 1 to x3 do begin
      if (mex[0]) then
        break;
      mex[get(x1, x2, x3 - i)] := true;
    end;

    for i := 1 to min(min(x1, x2), x3) do begin
      if (mex[0]) then
        break;
      mex[get(x1 - i, x2 - i, x3 - i)] := true;
    end;

    if (mex[0] = false) then
      result := 0
    else
      result := 1;

    f[x1][x2][x3] := result;
    f[x1][x3][x2] := result;
    f[x2][x1][x3] := result;
    f[x2][x3][x1] := result;
    f[x3][x1][x2] := result;
    f[x3][x2][x1] := result;
  end else begin
    result := f[x1][x2][x3];
  end;
end;

function get1(x1, x2: integer): integer;
var
  i: integer;
  mex: array[0..1] of boolean;
begin
  if (f[x1][x2][0] = -1) then begin
    for i := 0 to 1 do
      mex[i] := false;
    for i := 1 to x1 do begin
      mex[get1(x1 - i, x2)] := true;
    end;

    for i := 1 to x2 do begin
      mex[get1(x1, x2 - i)] := true;
    end;

    for i := 1 to min(x1, x2) do begin
      mex[get1(x1 - i, x2 - i)] := true;
    end;

    if (mex[0] = false) then
      result := 0
    else
      result := 1;
    f[x1][x2][0] := result;
    f[x2][x1][0] := result;
  end else begin
    result := f[x1][x2][0];
  end;
end;

begin
{  reset(input, 'input.txt');
  rewrite(output, 'output.txt');}

  readln(n);

  for i := 1 to n do begin
    read(a[i]);
  end;

  for i := 0 to a[1] do
    for j := 0 to a[2] do
      for k := 0 to a[3] do
        f[i][j][k] := -1;

  if (n = 1) then begin
    if (a[1] = 0) then
      writeln('BitAryo')
    else
      writeln('BitLGM');
    halt;
  end;

  if (n = 2) then begin
    if (get1(a[1], a[2]) = 0) then
      writeln('BitAryo')
    else
      writeln('BitLGM');
    halt;
  end;

  if (a[1] xor a[2] xor a[3] = 0) then
    writeln('BitAryo')
  else
    writeln('BitLGM');

end.

{$R-,S-,Q-,I-,O-}
{$M 32000000}

{$APPTYPE CONSOLE}

uses Math;
const
inf = round(1e9);
maxn = round(1e5) + 200;
md = round(1e9) + 7;
var
n,i,j,k : longint;
ok : boolean;
a : array [1..3] of longint;
dp : array [0..333,0..333] of boolean;
begin
 //reset (input,'input.txt');
 //rewrite (output,'output.txt');
 randomize;
 readln(n);
 for i:=1 to n do read(a[i]);
 if n = 1 then
 begin
  if a[1] = 0 then writeln('BitAryo')
              else writeln('BitLGM');
  halt;
 end;
 if n = 2 then
 begin
  fillchar(dp,sizeof(dp),true);
  dp[0][0]:=false;
  for i:=0 to a[1] do
   for j:=0 to a[2] do
   if not((i = 0) and (j = 0)) then
   begin
    ok:=false;
    for k:=1 to min(i,j) do
    if not dp[i - k,j - k] then ok:=true;
    for k:=1 to i do
    if not dp[i - k,j] then ok:=true;
    for k:=1 to j do
    if not dp[i,j - k] then ok:=true;
    dp[i,j]:=ok;
   end;
  if dp[a[1],a[2]] then writeln('BitLGM')
                   else writeln('BitAryo');
  halt;
 end;

 if a[1] xor a[2] xor a[3] = 0 then writeln('BitAryo')
                               else writeln('BitLGM');
end.

Uses math;
Var n,x,y:LongInt;
    a:Array[0..400,0..400] of Longint;
Procedure rec(x,y:LongInt);
Var t,i:LongInt;
 begin
   For i:=1 to x do
    begin
      if a[x-i,y]=0 then rec(x-i,y);
      if (a[x-i,y]=2) then begin a[x,y]:=1; exit; end;
    end;
   For i:=1 to y do
    begin
      if a[x,y-i]=0 then rec(x,y-i);
      if (a[x,y-i]=2) then begin a[x,y]:=1; exit; end;
    end;
   t:=min(x,y);
   For i:=1 to t do
     begin
       if a[x-i,y-i]=0 then rec(x-i,y-i);
       if a[x-i,y-i]=2 then begin a[x,y]:=1; exit; end;
     end;
   a[x,y]:=2;
 end;
  begin
    Read(n);
    if n=2 then
    begin
    Read(x,y);
    rec(x,y);
    if a[x,y]=1 then WriteLn('BitLGM')
    else WriteLn('BitAryo');
    end
    else if n=1 then begin read(x); if x>0 then WriteLn('BitLGM') else WriteLn('BitAryo'); end
    else
     begin
       Read(n,x,y);
       if (n xor x) xor y>0 then WriteLn('BitLGM')
       else WriteLn('BitAryo');
     end;
  end.

uses math;
var a:array [0..300] of longint;
    i,j,x,n,z,q:longint;ans:longint;
    s1,s2:ansistring;
    aa:array [0..300,0..300,0..300] of longint;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;
 procedure solve(x,y:longint);
 var i,j,z,q:longint;
     a:array [0..1000,0..1000] of longint;
   begin
     a[0,0]:=1;
     for i:=1 to 300 do
       for j:=1 to 300 do
         begin
           q:=0;
           for z:=1 to i do
             q:=q+a[i-z,j];
            for z:=1 to j do
              q:=q+a[i,j-z];
           for z:=1 to min (i,j) do
             q:=q+a[i-z,j-z];
           if q=0 then a[i,j]:=1 else a[i,j]:=0;
         end;
      wr (1-a[x,y]);
   end;
procedure solve3 (a,b,c:longint);
var i:longint;
  begin
    aa[a,b,c]:=-1;
    for i:=1 to 300-a do
      aa[a+i,b,c]:=1;
    for i:=1 to 300-b do
      aa[a,b+i,c]:=1;
    for i:=1 to 300-c do
      aa[a,b,c+i]:=1;
    for i:=1 to 300-max(max(a,b),c) do
      aa[a+i,b+i,c+i]:=1;
  end;

begin              {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output); }
readln (n);
for i:=1 to n do read (a[i]);
if (n=1) and (a[1]=0) then wr (0);
if n=1 then  wr (1);
if n=2 then
    solve(a[1],a[2]);
qsort (1,3);
//aa[0,0,0]:=-1;
for i:=0 to a[1] do
  for j:=0 to a[2] do
    for z:=0 to a[3] do
      begin
       if aa[i,j,z]=0 then
        solve3 (i,j,z);
      end;
q:=aa[a[1],a[2],a[3]];
if q=-1 then q:=0;
wr (q);

end.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE CONSOLE}

const file1='d.in';
      file2='d.out';
      oo=maxlongint div 2;
      empty='';
      eps=1e-6;
      dohrena=1e21;

var qc,he:array[0..2009]of longint;
    ss:array[0..2009]of string;
    qq,cc:array[0..500000]of longint;
    bb:array[0..500000]of boolean;
    xx,yy,zz:array[0..500000]of extended;
    a:array[0..331,0..331,0..331]of byte;
    aa:array[0..331,0..331]of byte;
    y,x,ii,jj,kk,t,test,u,v,w,n,m,r,p,q,c,h,e,r0,r1,r2,res:longint;
    s,s0,s1,s2:string;
    sss:ansistring;
    z,x0,x1,x2,y0,y1,y2,z0,z1,z2:extended;
    ch:char;
    b,b0,b1,b2:boolean;

procedure clear;
var i,j,k:longint;
    begin
    end;

procedure load;
var i,j,k:longint;
    begin
    read(n);
    for i:=1 to n do read(qc[i]);
    end;

procedure save;
var i,j,k:longint;
    begin
    if res=1 then writeln('BitLGM') else writeln('BitAryo');
    end;

procedure run;
var i,j,k:longint;
    begin
    res:=0;
    if n=1 then
      begin
      res:=1;
      if qc[1]=0 then res:=2;
      end;
    if n=2 then
      begin
      aa[0,0]:=0;
      for i:=0 to 320 do
        for j:=0 to 320 do
          if aa[i,j]=0 then
            begin
            for x:=i+1 to 310 do aa[x,j]:=1;
            for x:=j+1 to 310 do aa[i,x]:=1;
            y:=i;
            if j>y then y:=j;
            for x:=1 to 310-y do aa[i+x,j+x]:=1;
            end;
      if aa[qc[1],qc[2]]=0 then res:=2 else res:=1;
      end;
    if n=3 then
      begin
      a[0,0,0]:=0;
      for i:=0 to 320 do
        for j:=0 to 320 do
          for k:=0 to 320 do
            if a[i,j,k]=0 then
              begin
              for x:=i+1 to 310 do a[x,j,k]:=1;
              for x:=j+1 to 310 do a[i,x,k]:=1;
              for x:=k+1 to 310 do a[i,j,x]:=1;
              y:=i;
              if j>y then y:=j;
              if k>y then y:=k;
              for x:=1 to 310-y do a[i+x,j+x,k+x]:=1;
              end;
      if a[qc[1],qc[2],qc[3]]=0 then res:=2 else res:=1;
      end;
    end;

begin
{assign(input,file1);
assign(output,file2);
reset(input);
rewrite(output);{}
for t:=1 to 1 do
  begin
  clear;
  load;
  run;
  save;
  end;
{close(input);
close(output); {}
end.

program Project2;

{$APPTYPE CONSOLE}
//{$R+}

uses
  SysUtils, Math;

var
  a : array[1..3] of integer;
  n, i, j, x, k : integer;
  d : array[0..300, 0..300, 0..300] of boolean;
  was: array[0..300, 0..300] of integer;
  d2 : array[0..300, 0..300] of boolean;

function f(a, b, c : integer):boolean;
var
  x, y, z : integer;
begin
  x := min(a, b);
  y := max(c, a);
  z := a + b + c - x - y;
  result := d[x][z][y];
end;

procedure pr1;
begin
  writeln('BitLGM');
  halt;
end;

procedure pr2;
begin
  writeln('BitAryo');
  halt;
end;

begin
  {$IFNDEF ONLINE_JUDGE}
  reset(input ,'input.txt');
  rewrite(output, 'output.txt');
  {$ENDIF}
  read(n);

  for i := 1 to n do begin
    read(a[i]);
  end;
  if n = 1 then begin
    if a[1] = 0 then
      pr2 else
      pr1;
  end;

  if n = 2 then begin
    for i := 0 to a[1] do begin
      for j := 0 to a[2] do begin
        for x := 0 to i - 1 do begin
          if not d2[x][j] then
            d2[i][j] := true;
        end;
        for x := 0 to j - 1 do begin
          if not d2[i][x] then
            d2[i][j] := true;
        end;
        for x := 1 to min(i, j) do begin
          if not d2[i - x][j - x] then
            d2[i][j] := true;
        end;
      end;
    end;
    if d2[a[1]][a[2]] then
      pr1 else pr2;
  end;

  if n = 3 then begin
    i := a[1];
     j := a[2];
     k := a[3];
     a[1] := min(i, min(j, k));
     a[3] := max(i, max(j, k));
     a[2] := i + j + k - a[1] - a[3];
     n := 300;
  for i := 0 to n do begin
    for j := i to n do begin
      was[i][j] := -1;
      for k := j to n do begin
        d[i][j][k] := true;
      end;
    end;
  end;
  for i := 0 to n do begin
    for j := i to n do begin
      for k := j to n do begin
        if (was[i][j] = k) or
            (was[i][k] = j) or
            (was[j][k] = i) then begin
              break;
            end;
        d[i][j][k] := (was[i][j] >= 0) or (was[j][k] >= 0) or (was[i][k] >= 0);
        if not d[i][j][k] then begin
          for x := min(i, min(j, k)) downto 1  do begin
            if not d[i - x][j - x][k - x] then begin
              d[i][j][k] := true;
              break;
            end;
          end;
        end;
        if not d[i][j][k] then begin
          was[i][k] := j;
          was[j][k] := i;
          was[i][j] := k;
          break;
        end;
      end;
    end;
  end;
  if d[a[1]][a[2]][a[3]] then
    pr1 else
    pr2;

  end;

end.

program zzz;
 const
  ans:array[0..1] of string=('BitAryo','BitLGM');
 var
  a:array[1..3] of longint;
  n,i:longint;

 function min(x,y:longint):longint;
  begin
   if x>y
    then min:=y
    else min:=x;
  end;

 procedure sol2(x,y:longint);
  const
   n=300;
  var
   a,sx,sy,sd:array[0..500,0..500] of longint;
   i,j:longint;
  begin
   fillchar(a,sizeof(a),0);
   fillchar(sx,sizeof(sx),0);
   fillchar(sy,sizeof(sy),0);
   fillchar(sd,sizeof(sd),0);

   for i:=1 to 300 do
    begin
     a[0][i]:=1;
     a[i][0]:=1;
     sx[0][i]:=1;
     sx[i][0]:=1;
     sy[0][i]:=1;
     sy[i][0]:=1;
     sd[0][i]:=1;
     sd[i][0]:=1;
    end;

   for i:=1 to x do
    for j:=1 to y do
     begin
      if (sx[i-1][j]<i)or(sy[i][j-1]<j)
       or(sd[i-1][j-1]<min(i,j) )
        then
         begin
          a[i][j]:=1;
          sx[i][j]:=sx[i-1][j]+1;
          sy[i][j]:=sy[i][j-1]+1;
          sd[i][j]:=sd[i-1][j-1]+1;
         end
        else
         begin
          a[i][j]:=0;
          sx[i][j]:=sx[i-1][j];
          sy[i][j]:=sy[i][j-1];
          sd[i][j]:=sd[i-1][j-1];
         end;
    end;

   write(ans[ a[x][y] ]);
  end;

 procedure sol3(x,y,z:longint);
  begin
   if x xor y xor z=0
    then write(ans[0])
    else write(ans[1]);
  end;

 begin
  read(n);

  for i:=1 to n do
   begin
    read(a[i]);
   end;

  if n=1
   then
    begin
     if a[1]<>0
      then write(ans[1])
      else write(ans[0]);
    end;

  if n=2 then sol2(a[1],a[2]);

  if n=3 then sol3(a[1],a[2],a[3]);

end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[1]<=2) then wr (1);
    if (a[2]-a[1]<=1) then wr (1);
    wr (0);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);
if (a[1]=0) and (a[2]>=2) then wr (0);
wr (1);
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;
 procedure solve(x,y:longint);
 var i,j,z,q:longint;
     a:array [0..1000,0..1000] of longint;
   begin
     a[0,0]:=1;
     for i:=1 to 300 do
       for j:=1 to 300 do
         begin
           q:=0;
           for z:=1 to i do
             q:=q+a[i-z,j];
            for z:=1 to j do
              q:=q+a[i,j-z];
           for z:=1 to min (i,j) do
             q:=q+a[i-z,j-z];
           if q=0 then a[i,j]:=1 else a[i,j]:=0;
         end;
      wr (1-a[x,y]);
   end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if (n=1) and (a[1]=0) then wr (0);
if n=1 then
  wr (1);
if n=2 then
  begin
    solve(a[1],a[2]);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);

if (a[1]=0) and (a[2]>=2)  then wr (0);
wr (1);
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[1]>=3) and (a[1] mod 2=1) and (a[2]=a[1]+1) then wr (0);
    wr (1);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);
if (a[1]=0) and (a[2]>=2) then wr (0);
wr (1);
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if (n=1) and (a[1]=0) then wr (0);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[1]<=2) then wr (1);
    if (a[2]-a[1]<=1) then wr (1);
    if (a[1]>=3) and (a[2]-a[1]=a[1]-1) then wr (0);
    wr (1);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);

if (a[1]=0) and (a[2]>=2)  then wr (0);
wr (1);
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[2]-a[1]<=1) then wr (1);
    //if (a[1] mod 2=1) and (a[2]=a[1]+1) then wr (0);
    wr (0);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);
if (a[1]=0) and (a[2]>=2) then wr (0);
wr (1);
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if (n=1) and (a[1]=0) then wr (0);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[1]<=2) then wr (1);
    if (a[2]-a[1]<=1) then wr (1);
    if a[1]>=4 then wr (1);
    wr (0);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);

if (a[1]=0) and (a[2]>=2)  then wr (0);
wr (1);
end.

uses math;
var a:array [0..300] of longint;
    i,j,x,n,o,q:longint;ans:longint;
    s1,s2:ansistring;
    aa:array [0..300,0..300,0..300] of longint;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;
 procedure solve(x,y:longint);
 var i,j,z,q:longint;
     a:array [0..1000,0..1000] of longint;
   begin
     a[0,0]:=1;
     for i:=1 to 300 do
       for j:=1 to 300 do
         begin
           q:=0;
           for z:=1 to i do
             q:=q+a[i-z,j];
            for z:=1 to j do
              q:=q+a[i,j-z];
           for z:=1 to min (i,j) do
             q:=q+a[i-z,j-z];
           if q=0 then a[i,j]:=1 else a[i,j]:=0;
         end;
      wr (1-a[x,y]);
   end;
{procedure solve3(x,y,v:longint);
 var i,j,z,q,ii:longint;

   begin
     aa[0,0,0]:=1;
     for i:=0 to 300 do
       for j:=0 to 300 do
         for ii:=0 to 300 do
         begin
           q:=0;
           for z:=1 to i do
             q:=q+aa[i-z,j,ii];

            for z:=1 to j do
              q:=q+aa[i,j-z,ii];
            for z:=1 to ii do
              q:=q+aa[i,j,ii-z];
           for z:=1 to min (i,min(j,ii)) do
             q:=q+aa[i-z,j-z,ii-z];
           if q=0 then aa[i,j,ii]:=1 else aa[i,j,ii]:=0;
         end;
      wr (1-aa[x,y,v]);
   end; }
function solve3(x,y,v:longint):longint;
 var i,j,z,q,ii:longint;

   begin
     if aa[x,y,v]<>0 then
        exit (aa[x,y,v]);
     for i:=1 to x do
      if aa[x-i,y,v]=-1 then exit(1);
     for i:=1 to y do
       if aa[x,y-i,v]=-1 then exit(1);
     for i:=1 to v do
       begin
         if aa[x,y,v-i]=-1 then exit (1);
       end;
     for i:=1 to min (min(x,y),v) do
       if aa[x-i,y-i,v-i]=-1 then exit (1);
      for i:=1 to min (min(x,y),v) do
          if aa[x-i,y-i,v-i]=0 then
        begin
          q:=solve3 (x-i,y-i,v-i);
          aa[x-i,y-i,v-i]:=q;
          if q=-1 then exit(1);
        end;
     for i:=1 to x do
      if aa[x-i,y,v]=0 then
        begin
          q:=solve3 (x-i,y,v);
          aa[x-i,y,v]:=q;
          if q=-1 then exit(1);
        end;
     for i:=1 to y do

       if aa[x,y-i,v]=0 then
        begin
          q:=solve3 (x,y-i,v);
          aa[x,y-i,v]:=q;
          if q=-1 then exit(1);
        end;
     for i:=1 to v do
       if aa[x,y,v-i]=0 then
        begin
          q:=solve3 (x,y,v-i);
          aa[x,y,v-i]:=q;
          if q=-1 then exit(1);
        end;
     aa[x,y,v]:=-1;
     exit(-1);
   end;

begin              {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output); }
readln (n);
for i:=1 to n do read (a[i]);
if (n=1) and (a[1]=0) then wr (0);
if n=1 then
  wr (1);
if n=2 then
  begin
    solve(a[1],a[2]);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
aa[0,0,0]:=-1;
q:=solve3 (a[1],a[2],a[3]);
if q=-1 then q:=0;
wr (q);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);

if (a[1]=0) and (a[2]>=2)  then wr (0);
wr (1);
end.

program zzz;
 const
  ans:array[0..1] of string=('BitAryo','BitLGM');
 var
  a:array[1..3] of longint;
  n,i:longint;

 function min(x,y:longint):longint;
  begin
   if x>y
    then min:=y
    else min:=x;
  end;

 procedure sol2(x,y:longint);
  const
   n=300;
  var
   a,sx,sy,sd:array[0..500,0..500] of longint;
   i,j:longint;
  begin
   fillchar(a,sizeof(a),0);
   fillchar(sx,sizeof(sx),0);
   fillchar(sy,sizeof(sy),0);
   fillchar(sd,sizeof(sd),0);

   for i:=1 to 300 do
    begin
     a[0][i]:=1;
     a[i][0]:=1;
     sx[0][i]:=1;
     sx[i][0]:=1;
     sd[i][0]:=1;
     sd[0][i]:=1;
    end;

   for i:=1 to n do
    for j:=1 to n do
     begin
      if (sx[i-1][j]<i-1)or(sy[i][j-1]<j-1)
       or(sd[i-1][j-1]<min(i-1,j-1) )
        then
         begin
          a[i][j]:=1;
          sx[i][j]:=sx[i-1][j]+1;
          sy[i][j]:=sy[i][j-1]+1;
          sd[i][j]:=sd[i-1][j-1]+1;
         end
        else
         begin
          a[i][j]:=0;
          sx[i][j]:=sx[i-1][j];
          sy[i][j]:=sy[i][j-1];
          sd[i][j]:=sd[i-1][j-1];
         end;
    end;

   write(ans[ 1 - a[x][y] ]);
  end;

 procedure sol3(x,y,z:longint);
  begin
   if x xor y xor z=0
    then write(ans[0])
    else write(ans[1]);
  end;

 begin
  read(n);

  for i:=1 to n do
   begin
    read(a[i]);
   end;

  if n=1 then write(ans[1]);

  if n=2 then sol2(a[1],a[2]);

  if n=3 then sol3(a[1],a[2],a[3]);

end.

program zzz;
 const
  ans:array[0..1] of string=('BitAryo','BitLGM');
 var
  a:array[1..3] of longint;
  n,i:longint;

 function min(x,y:longint):longint;
  begin
   if x>y
    then min:=y
    else min:=x;
  end;

 procedure sol2(x,y:longint);
  const
   n=300;
  var
   a,sx,sy,sd:array[0..500,0..500] of longint;
   i,j:longint;
  begin
   fillchar(a,sizeof(a),0);
   fillchar(sx,sizeof(sx),0);
   fillchar(sy,sizeof(sy),0);
   fillchar(sd,sizeof(sd),0);

   for i:=1 to 300 do
    begin
     a[0][i]:=1;
     a[i][0]:=1;
     sx[0][i]:=1;
     sx[i][0]:=1;
     sy[0][i]:=1;
     sy[i][0]:=1;
     sd[0][i]:=1;
     sd[i][0]:=1;
    end;

   for i:=1 to x do
    for j:=1 to y do
     begin
      if (sx[i-1][j]<i)or(sy[i][j-1]<j)
       or(sd[i-1][j-1]<min(i,j) )
        then
         begin
          a[i][j]:=1;
          sx[i][j]:=sx[i-1][j]+1;
          sy[i][j]:=sy[i][j-1]+1;
          sd[i][j]:=sd[i-1][j-1]+1;
         end
        else
         begin
          a[i][j]:=0;
          sx[i][j]:=sx[i-1][j];
          sy[i][j]:=sy[i][j-1];
          sd[i][j]:=sd[i-1][j-1];
         end;
    end;

   write(ans[ a[x][y] ]);
  end;

 procedure sol3(x,y,z:longint);
  begin
   if x xor y xor z=0
    then write(ans[0])
    else write(ans[1]);
  end;

 begin
  read(n);

  for i:=1 to n do
   begin
    read(a[i]);
   end;

  if n=1 then write(ans[1]);

  if n=2 then sol2(a[1],a[2]);

  if n=3 then sol3(a[1],a[2],a[3]);

end.

Uses math;
var s,n,i,m,j,k,x:longint;
    a:array[0..3]of longint;
    dp:array[0..300,0..300]of longint;
 begin
  read(n);
  for i:=1 to n do
   begin
    read(x);
    if(x>0)then
     begin
      inc(m);
      a[m]:=x;
     end;
   end;
  n:=m;m:=300;
  if(n=0)then
   begin
    writeln('BitLGM');
    exit;
   end;
  if(n=1)then
   begin
    writeln('BitAryo');
    exit;
   end;
  if(n=2)then
   begin
    for i:=0 to m do
     for j:=0 to m do
      begin
       if(i=0)and(j=0)then continue;
       for k:=1 to min(i,j) do
        if(dp[i-k][j-k]=0)then dp[i,j]:=1;
       for k:=1 to i do
        if(dp[i-k][j]=0)then dp[i,j]:=1;
       for k:=1 to j do
        if(dp[i][j-k]=0)then dp[i,j]:=1;
      end;
    if(dp[a[1],a[2]]=0)then write('BitAryo')
                       else write('BitLGM');
    exit;
   end;
  if(n=3)then
   begin
    s:=a[1] xor a[2] xor a[3];
    if(s>0)Then writeln('BitLGM')
           else writeln('BitAryo');
    exit;
   end;
 end.

Uses math;
var s,n,i,m,j,k,x:longint;
    a:array[0..3]of longint;
    dp:array[0..300,0..300]of longint;
 begin
  read(n);
  for i:=1 to n do
   begin
    read(x);
    if(x>0)then
     begin
      inc(m);
      a[m]:=x;
     end;
   end;
  n:=m;m:=300;
  if(n=0)then
   begin
    writeln('BitAryo');
    exit;
   end;
  if(n=1)then
   begin
    writeln('BitAryo');
    exit;
   end;
  if(n=2)then
   begin
    for i:=0 to m do
     for j:=0 to m do
      begin
       if(i=0)and(j=0)then continue;
       for k:=1 to min(i,j) do
        if(dp[i-k][j-k]=0)then dp[i,j]:=1;
       for k:=1 to i do
        if(dp[i-k][j]=0)then dp[i,j]:=1;
       for k:=1 to j do
        if(dp[i][j-k]=0)then dp[i,j]:=1;
      end;
    if(dp[a[1],a[2]]=0)then write('BitAryo')
                       else write('BitLGM');
    exit;
   end;
  if(n=3)then
   begin
    s:=a[1] xor a[2] xor a[3];
    if(s>0)Then writeln('BitLGM')
           else writeln('BitAryo');
    exit;
   end;
 end.

Uses math;
var s,n,i,m,j,k,x:longint;
    a:array[0..3]of longint;
    dp:array[0..300,0..300]of longint;
 begin
  read(n);
  for i:=1 to n do
    read(a[i]);
  m:=300;
  if(n=1)then
   begin
    writeln('BitLGM');
    exit;
   end;
  if(n=2)then
   begin
    for i:=0 to m do
     for j:=0 to m do
      begin
       if(i=0)and(j=0)then continue;
       for k:=1 to min(i,j) do
        if(dp[i-k][j-k]=0)then dp[i,j]:=1;
       for k:=1 to i do
        if(dp[i-k][j]=0)then dp[i,j]:=1;
       for k:=1 to j do
        if(dp[i][j-k]=0)then dp[i,j]:=1;
      end;
    if(dp[a[1],a[2]]=0)then write('BitAryo')
                       else write('BitLGM');
    exit;
   end;
  if(n=3)then
   begin
    s:=a[1] xor a[2] xor a[3];
    if(s>0)Then writeln('BitLGM')
           else writeln('BitAryo');
    exit;
   end;
 end.

Uses math;
var s,n,i,m,j,k,x:longint;
    a:array[0..3]of longint;
    dp:array[0..300,0..300]of longint;
 begin
  read(n);
  for i:=1 to n do
   begin
    read(x);
    if(x>0)then
     begin
      inc(m);
      a[m]:=x;
     end;
   end;
  n:=m;m:=300;
  if(n=0)then
   begin
    writeln('BitAryo');
    exit;
   end;
  if(n=1)then
   begin
    writeln('BitLGM');
    exit;
   end;
  if(n=2)then
   begin
    for i:=0 to m do
     for j:=0 to m do
      begin
       if(i=0)and(j=0)then continue;
       for k:=1 to min(i,j) do
        if(dp[i-k][j-k]=0)then dp[i,j]:=1;
       for k:=1 to i do
        if(dp[i-k][j]=0)then dp[i,j]:=1;
       for k:=1 to j do
        if(dp[i][j-k]=0)then dp[i,j]:=1;
      end;
    if(dp[a[1],a[2]]=0)then write('BitAryo')
                       else write('BitLGM');
    exit;
   end;
  if(n=3)then
   begin
    s:=a[1] xor a[2] xor a[3];
    if(s>0)Then writeln('BitLGM')
           else writeln('BitAryo');
    exit;
   end;
 end.

var i,n,x:longint;
    a:array[0..3]of longint;
 begin
  read(n);
  for i:=1 to n do
   begin
    read(a[i]);
    x:=x xor a[i];
   end;
  if(x mod 2=0)then writeln('BitLGM')
               else writeln('BitAryo');
 end.

Uses math;
var s,n,i,m,j,k,x:longint;
    a:array[0..3]of longint;
    dp:array[0..300,0..300]of longint;
 begin
  read(n);
  for i:=1 to n do
   begin
    read(x);
    if(x>0)then
     begin
      inc(m);
      a[m]:=x;
     end;
   end;
  n:=m;m:=300;
  if(n=0)then
   begin
    writeln('BitLGM');
    exit;
   end;
  if(n=1)then
   begin
    writeln('BitAryo');
    exit;
   end;
  if(n=2)then
   begin
    for i:=1 to m do
     for j:=1 to m do
      begin
       for k:=1 to min(i,j) do
        if(dp[i-k][j-k]=0)then dp[i,j]:=1;
       for k:=1 to i do
        if(dp[i-k][j]=0)then dp[i,j]:=1;
       for k:=1 to j do
        if(dp[i][j-k]=0)then dp[i,j]:=1;
      end;
    if(dp[a[1],a[2]]=0)then write('BitAryo')
                      else write('BitLGM');
    exit;
   end;
  if(n=3)then
   begin
    s:=a[1] xor a[2] xor a[3];
    if(s>0)Then writeln('BitLGM')
           else writeln('BitAryo');
    exit;
   end;
 end.

Uses math;
Var a:array[0..301,0..301,0..301] of integer;
    n,i,j,k,ii,jj,kk:longint;
Procedure fill(iii,jjj,kkk:longint);
Var i,j,t,k:longint;
Begin
     a[iii,jjj,kkk]:=1;

     For i:=iii+1 to ii do a[i,jjj,kkk]:=2;
     For j:=jjj+1 to jj do a[iii,j,kkk]:=2;
     For k:=kkk+1 to kk do a[iii,jjj,k]:=2;

     For t:=1 to min(ii-iii,jj-jjj) do a[iii+t,jjj+t,kkk]:=2;

     For t:=1 to min(ii-iii,kk-kkk) do a[iii+t,jjj,kkk+t]:=2;

     For t:=1 to min(jj-jjj,kk-kkk) do a[iii,jjj+t,kkk+t]:=2;

     For t:=1 to min(ii-iii,min(jj-jjj,kk-kkk)) do a[iii+t,jjj+t,kkk+t]:=2;

     if a[ii,jj,kk]=2 then begin WRiteln('BitLGM'); halt end;
     if a[ii,jj,kk]=1 then begin WRiteln('BitAryo'); halt end;

End;

Begin
     Readln(n);
     if n=1 then begin Readln(ii);
      if ii=0 then writeln('BitAryo') else WRiteln('BitLGM');
      halt
     end;
     if n=2 then begin Readln(ii,jj); kk:=0 end;
     if n=3 then begin
      Readln(ii,jj,kk);
//      jj:=jj xor kk; kk:=0;
     end;

     For i:=0 to ii do
      For j:=0 to jj do
       For k:=0 to kk do
        if a[i,j,k]=0 then fill(i,j,k);

  End.

Uses math;
Var a:array[0..301,0..301,0..301] of integer;
    n,i,j,k,ii,jj,kk:longint;
Procedure fill(iii,jjj,kkk:longint);
Var i,j,t,k:longint;
Begin
     a[iii,jjj,kkk]:=1;

     For i:=iii+1 to ii do a[i,jjj,kkk]:=2;
     For j:=jjj+1 to jj do a[iii,j,kkk]:=2;
     For k:=kkk+1 to kk do a[iii,jjj,k]:=2;

     For t:=1 to min(ii-iii,jj-jjj) do a[iii+t,jjj+t,kkk]:=2;

     For t:=1 to min(ii-iii,kk-kkk) do a[iii+t,jjj,kkk+t]:=2;

     For t:=1 to min(jj-jjj,kk-kkk) do a[iii,jjj+t,kkk+t]:=2;

     For t:=1 to min(ii-iii,min(jj-jjj,kk-kkk)) do a[iii+t,jjj+t,kkk+t]:=2;

     if a[ii,jj,kk]=2 then begin WRiteln('BitLGM'); halt end;
     if a[ii,jj,kk]=1 then begin WRiteln('BitAryo'); halt end;

End;

Begin
     Readln(n);
     if n=1 then begin Readln(ii); WRiteln('BitLGM'); halt end;
     if n=2 then begin Readln(ii,jj); kk:=0 end;
     if n=3 then Readln(ii,jj,kk);

     For i:=0 to ii do
      For j:=0 to jj do
       For k:=0 to kk do
        if a[i,j,k]=0 then fill(i,j,k);

End.

Uses math;
Var a:array[0..301,0..301,0..301] of integer;
    n,i,j,k,ii,jj,kk:longint;
Procedure fill(iii,jjj,kkk:longint);
Var i,j,t,k:longint;
Begin
     a[iii,jjj,kkk]:=1;

     For i:=iii+1 to ii do a[i,jjj,kkk]:=2;
     For j:=jjj+1 to jj do a[iii,j,kkk]:=2;
     For k:=kkk+1 to kk do a[iii,jjj,k]:=2;

     For t:=1 to min(ii-iii,jj-jjj) do a[iii+t,jjj+t,kkk]:=2;

     For t:=1 to min(ii-iii,kk-kkk) do a[iii+t,jjj,kkk+t]:=2;

     For t:=1 to min(jj-jjj,kk-kkk) do a[iii,jjj+t,kkk+t]:=2;

     For t:=1 to min(ii-iii,min(jj-jjj,kk-kkk)) do a[iii+t,jjj+t,kkk+t]:=2;

     if a[ii,jj,kk]=2 then begin WRiteln('BitLGM'); halt end;
     if a[ii,jj,kk]=1 then begin WRiteln('BitAryo'); halt end;

End;

Begin
     Readln(n);
     if n=1 then begin Readln(ii); WRiteln('BitLGM'); halt end;
     if n=2 then begin Readln(ii,jj); kk:=0 end;
     if n=3 then begin
      Readln(ii,jj,kk);
      jj:=jj xor kk; kk:=0;
     end;

     For i:=0 to ii do
      For j:=0 to jj do
       For k:=0 to kk do
        if a[i,j,k]=0 then fill(i,j,k);

  End.

Uses math;
Var a:array[0..301,0..301,0..301] of integer;
    n,i,j,k,ii,jj,kk:longint;
Procedure fill(iii,jjj,kkk:longint);
Var i,j,t,k:longint;
Begin
     a[iii,jjj,kkk]:=1;

     For i:=iii+1 to ii do a[i,jjj,kkk]:=2;
     For j:=jjj+1 to jj do a[iii,j,kkk]:=2;
     For k:=kkk+1 to kk do a[iii,jjj,k]:=2;

     For t:=1 to min(ii-iii,jj-jjj) do a[iii+t,jjj+t,kkk]:=2;

     For t:=1 to min(ii-iii,kk-kkk) do a[iii+t,jjj,kkk+t]:=2;

     For t:=1 to min(jj-jjj,kk-kkk) do a[iii,jjj+t,kkk+t]:=2;

     For t:=1 to min(ii-iii,min(jj-jjj,kk-kkk)) do a[iii+t,jjj+t,kkk+t]:=2;

     if a[ii,jj,kk]=2 then begin WRiteln('BitLGM'); halt end;
     if a[ii,jj,kk]=1 then begin WRiteln('BitAryo'); halt end;

End;

Begin
     Readln(n);
     if n=1 then begin Readln(ii);
      if ii=0 then writeln('BitAryo') else WRiteln('BitLGM');
      halt
     end;
     if n=2 then begin Readln(ii,jj); kk:=0 end;
     if n=3 then begin
      Readln(ii,jj,kk);
      if (ii xor jj) xor kk=0 then
       writeln('BitAryo') else WRiteln('BitLGM');
     end;

     For i:=0 to ii do
      For j:=0 to jj do
       For k:=0 to kk do
        if a[i,j,k]=0 then fill(i,j,k);

  End.

Uses math;
Var a:array[0..301,0..301,0..301] of integer;
    n,i,j,k,ii,jj,kk:longint;
Procedure fill(iii,jjj,kkk:longint);
Var i,j,t,k:longint;
Begin
     a[iii,jjj,kkk]:=1;

     For i:=iii+1 to ii do a[i,jjj,kkk]:=2;
     For j:=jjj+1 to jj do a[iii,j,kkk]:=2;
     For k:=kkk+1 to kk do a[iii,jjj,k]:=2;

     For t:=1 to min(ii-iii,jj-jjj) do a[iii+t,jjj+t,kkk]:=2;

     For t:=1 to min(ii-iii,kk-kkk) do a[iii+t,jjj,kkk+t]:=2;

     For t:=1 to min(jj-jjj,kk-kkk) do a[iii,jjj+t,kkk+t]:=2;

     For t:=1 to min(ii-iii,min(jj-jjj,kk-kkk)) do a[iii+t,jjj+t,kkk+t]:=2;

     if a[ii,jj,kk]=2 then begin WRiteln('BitLGM'); halt end;
     if a[ii,jj,kk]=1 then begin WRiteln('BitAryo'); halt end;

End;

Begin
     Readln(n);
     if n=1 then begin Readln(ii);
      if ii=0 then writeln('BitAryo') else WRiteln('BitLGM');
      halt
     end;
     if n=2 then begin Readln(ii,jj); kk:=0 end;
     if n=3 then begin
      Readln(ii,jj,kk);
      if (ii xor jj) xor kk=0 then
       WRiteln('BitLGM') else writeln('BitAryo');
     end;

     For i:=0 to ii do
      For j:=0 to jj do
       For k:=0 to kk do
        if a[i,j,k]=0 then fill(i,j,k);

  End.

Uses math;
Var a:array[0..301,0..301,0..301] of integer;
    n,i,j,k,ii,jj,kk:longint;
Procedure fill(iii,jjj,kkk:longint);
Var i,j,t,k:longint;
Begin
     a[iii,jjj,kkk]:=1;

     For i:=iii+1 to ii do a[i,jjj,kkk]:=2;
     For j:=jjj+1 to jj do a[iii,j,kkk]:=2;
     For k:=kkk+1 to kk do a[iii,jjj,k]:=2;

     For t:=1 to min(ii-iii,jj-jjj) do a[iii+t,jjj+t,kkk]:=2;

     For t:=1 to min(ii-iii,kk-kkk) do a[iii+t,jjj,kkk+t]:=2;

     For t:=1 to min(jj-jjj,kk-kkk) do a[iii,jjj+t,kkk+t]:=2;

     For t:=1 to min(ii-iii,min(jj-jjj,kk-kkk)) do a[iii+t,jjj+t,kkk+t]:=2;

     if a[ii,jj,kk]=2 then begin WRiteln('BitLGM'); halt end;
     if a[ii,jj,kk]=1 then begin WRiteln('BitAryo'); halt end;

End;

Begin
     Readln(n);
     if n=1 then begin Readln(ii);
      if ii=0 then writeln('BitAryo') else WRiteln('BitLGM');
      halt
     end;
     if n=2 then begin Readln(ii,jj); kk:=0 end;
     if n=3 then begin
      Readln(ii,jj,kk);
      jj:=jj xor kk; kk:=0;
     end;

     For i:=0 to ii do
      For j:=0 to jj do
       For k:=0 to kk do
        if a[i,j,k]=0 then fill(i,j,k);

  End.

uses
  math;

var
  f:array[0..333,0..333]of longint;
  n,m,k,i,j:longint;

begin
  read(n);
  if (n=1)then begin
    read(n);
    if (n>0)then writeln('BitLGM')else writeln('BitAryo');
  end else
  if (n=3)then begin
    read(n,m,k);
    n:=n xor m xor k;
    if (n>0)then writeln('BitLGM')else writeln('BitAryo');
  end else begin
    read(n,m);
    for i:=0 to n do
      for j:=0 to m do
        for k:=1 to max(i,j)do
          if ((k<=i)and(f[i-k][j]=0))or
              ((k<=j)and(f[i][j-k]=0))or
              ((k<=i)and(k<=j)and(f[i-k][j-k]=0))
                then begin f[i][j]:=1;break; end;
    for i:=1 to n do begin writeln;
    for j:=1 to m do write(f[i][j],' ');
    end;

    if (f[n][m]=1)then writeln('BitLGM')else writeln('BitAryo');
  end;
end.

program cf173d;
var
  a : array [0..299, 0..299, 0..299] of integer;
  b : array [0..299, 0..299] of integer;
  i, j, k, u, m, n, s, x, y, z : longint;
begin
readln(n);
if n = 1 then
  begin
    s := 1;
    readln(x);
    if x = 0 then
      s := 2;
  end;
if n = 2 then
  begin
    for i := 0 to 299 do
      for j := 0 to 299 do
        b[i, j] := 0;
    for i := 0 to 299 do
      for j := 0 to 299 do
       begin
         if b[i, j] = 0 then
           begin
             if i > j then
               m := i
             else
               m := j;
             m := 299 - m;
             for u := 1 to m do
               b[i + u, j + u] := 1;
             u := i + 1;
             while (u <= 299) do
               begin
                 b[u, j] := 1;
                 inc(u);
               end;
             u := j + 1;
             while (u <= 299) do
               begin
                 b[i, u] := 1;
                 inc(u);
               end;
             b[i, j] := 2;
           end;
       end;
    readln(x, y);
    s := b[x, y];
  end;
if n = 3 then
  begin
    for i := 0 to 299 do
      for j := 0 to 299 do
        for k := 0 to 299 do
          a[i, j, k] := 0;
    a[0, 0, 0] := 2;
    for i := 0 to 299 do
      for j := 0 to 299 do
        for k := 0 to 299 do
          begin
            if a[i, j, k] = 0 then
              a[i, j, k] := 1;
            if a[i, j, k] = 2 then
              begin
                u := i + 1;
                while (u <= 299) do
                  begin
                    a[u, j, k] := 1;
                    inc(u);
                  end;
                u := j + 1;
                while (u <= 299) do
                  begin
                    a[i, u, k] := 1;
                    inc(u);
                  end;
                u := k + 1;
                while (u <= 299) do
                  begin
                    a[i, j, u] := 1;
                    inc(u);
                  end;
                m := i;
                if j > m then
                  m := j;
                if k > m then
                  m := k;
                m := 299 - m;
                for u := 1 to m do
                  a[i + u, j + u, k + u] := 1;
              end;
          end;
      readln(x, y, z);
      s := a[x, y, z];
  end;
if s = 1 then
  writeln('BitLGM')
else
  writeln('BitAryo');
end.

Uses math;
Var n,x,y:LongInt;
    a:Array[0..400,0..400] of Longint;
Procedure rec(x,y:LongInt);
Var t,i:LongInt;
 begin
   For i:=1 to x do
    begin
      if a[x-i,y]=0 then rec(x-i,y);
      if (a[x-i,y]=2) then begin a[x,y]:=1; exit; end;
    end;
   For i:=1 to y do
    begin
      if a[x,y-i]=0 then rec(x,y-i);
      if (a[x,y-i]=2) then begin a[x,y]:=1; exit; end;
    end;
   t:=min(x,y);
   For i:=1 to t do
     begin
       if a[x-i,y-i]=0 then rec(x-i,y-i);
       if a[x-i,y-i]=2 then begin a[x,y]:=1; exit; end;
     end;
   a[x,y]:=2;
 end;
  begin
    Read(n);
    if n=2 then
    begin
    Read(x,y);
    rec(x,y);
    if a[x,y]=1 then WriteLn('BitLGM')
    else WriteLn('BitAryo');
    end
    else if n=1 then begin read(x); if x>0 then WriteLn('BitAryo') else WriteLn('BitLGM'); end
    else
     begin
       Read(n,x,y);
       if (n xor x) xor y>0 then WriteLn('BitLGM')
       else WriteLn('BitAryo');
     end;
  end.

Uses math;
Var n,x,y:LongInt;
    a:Array[0..400,0..400] of Longint;
Procedure rec(x,y:LongInt);
Var t,i:LongInt;
 begin
   For i:=1 to x do
    if (a[x-i,y]=1) then begin a[x,y]:=2; exit; end
    else if (a[x-i,y]=2) then begin a[x,y]:=1; exit; end
    else begin rec(x-i,y); a[x,y]:=(a[x-i,y] mod 2)+1; exit; end;
   For i:=1 to y do
    if a[x,y-i]=1 then begin a[x,y-i]:=2; exit; end
    else if (a[x,y-i]=2) then begin a[x,y-i]:=1; exit; end
    else begin rec(x,y-i);  a[x,y]:=(a[x,y-i] mod 2)+1; exit; end;
   t:=min(x,y);
   For i:=1 to t do
   if a[x-t,y-t]=2 then begin a[x-t,y-t]:=1; exit; end
   else if a[x-t,y-t]=1 then begin a[x-t,y-t]:=2; exit; end
   else begin rec(x-t,y-t); a[x,y]:=(a[x-t,y-t] mod 2)+1; exit; end;
 end;
  begin
    Read(n);
    if n=2 then
    begin
    Read(x,y);
    a[0,0]:=1;
    rec(x,y);
    if a[x,y]=1 then WriteLn('BitLGM')
    else WriteLn('BitAryo');
    end
    else if n=1 then begin read(x); if x>0 then WriteLn('BitAryo') else WriteLn('BitLGM'); end
    else
     begin
       Read(n,x,y);
       if (n xor x) xor y>0 then WriteLn('BitLGM')
       else WriteLn('BitAryo');
     end;
  end.

Uses math;
Var n,x,y:LongInt;
    a:Array[0..400,0..400] of Longint;
Procedure rec(x,y:LongInt);
Var t,i:LongInt;
 begin
   For i:=1 to x do
    if (a[x-i,y]=2) then begin a[x,y]:=1; exit; end
    else begin rec(x-i,y); a[x,y]:=(a[x-i,y] mod 2)+1; exit; end;
   For i:=1 to y do
    if (a[x,y-i]=2) then begin a[x,y-i]:=1; exit; end
    else begin rec(x,y-i);  a[x,y]:=(a[x,y-i] mod 2)+1; exit; end;
   t:=min(x,y);
   For i:=1 to t do
   if a[x-t,y-t]=2 then begin a[x-t,y-t]:=1; exit; end
   else begin rec(x-t,y-t); a[x,y]:=(a[x-t,y-t] mod 2)+1; exit; end;
   a[x,y]:=2;
 end;
  begin
    Read(n);
    if n=2 then
    begin
    Read(x,y);
    a[0,0]:=1;
    rec(x,y);
    if a[x,y]=1 then WriteLn('BitLGM')
    else WriteLn('BitAryo');
    end
    else if n=1 then begin read(x); if x>0 then WriteLn('BitAryo') else WriteLn('BitLGM'); end
    else
     begin
       Read(n,x,y);
       if (n xor x) xor y>0 then WriteLn('BitLGM')
       else WriteLn('BitAryo');
     end;
  end.

Uses math;
Var n,x,y:LongInt;
    a:Array[0..400,0..400] of Longint;
Procedure rec(x,y:LongInt);
Var t,i:LongInt;
 begin
   For i:=1 to x do
    if (a[x-i,y]=2) then begin a[x,y]:=1; exit; end
    else begin rec(x-i,y); if a[x-i,y]=2 then begin a[x,y]:=(a[x-i,y] mod 2)+1; exit; end;  end;
   For i:=1 to y do
    if (a[x,y-i]=2) then begin a[x,y-i]:=1; exit; end
    else begin rec(x,y-i); if a[x,y-i]=2 then  begin a[x,y]:=(a[x,y-i] mod 2)+1; exit;end;  end;
   t:=min(x,y);
   For i:=1 to t do
   if a[x-i,y-i]=2 then begin a[x-i,y-i]:=1; exit; end
   else
   begin
     rec(x-i,y-i);
     if a[x-i,y-i]=2 then
       begin
        a[x,y]:=(a[x-i,y-i] mod 2)+1;
        exit;
       end;
   end;
   a[x,y]:=2;
 end;
  begin
    Read(n);
    if n=2 then
    begin
    Read(x,y);
    rec(x,y);
    if a[x,y]=1 then WriteLn('BitLGM')
    else WriteLn('BitAryo');
    end
    else if n=1 then begin read(x); if x>0 then WriteLn('BitAryo') else WriteLn('BitLGM'); end
    else
     begin
       Read(n,x,y);
       if (n xor x) xor y>0 then WriteLn('BitLGM')
       else WriteLn('BitAryo');
     end;
  end.

Uses math;
Var n,x,y:LongInt;
    a:Array[0..400,0..400] of Longint;
Procedure rec(x,y:LongInt);
Var t,i:LongInt;
 begin
   For i:=1 to x do
    if (a[x-i,y]=1) then begin a[x,y]:=2; exit; end
    else if (a[x-i,y]=2) then begin a[x,y]:=1; exit; end
    else begin rec(x-i,y); a[x,y]:=(a[x-i,y] mod 2)+1; exit; end;
   For i:=1 to y do
    if a[x,y-i]=1 then begin a[x,y-i]:=2; exit; end
    else if (a[x,y-i]=2) then begin a[x,y-i]:=1; exit; end
    else begin rec(x,y-i);  a[x,y]:=(a[x,y-i] mod 2)+1; exit; end;
   t:=min(x,y);
   For i:=1 to t do
   if a[x-i,y-i]=2 then begin a[x-i,y-i]:=1; exit; end
   else if a[x-i,y-i]=1 then begin a[x-i,y-i]:=2; exit; end
   else begin rec(x-i,y-i); a[x,y]:=(a[x-i,y-i] mod 2)+1; exit; end;
 end;
  begin
    Read(n);
    if n=2 then
    begin
    Read(x,y);
    a[0,0]:=1;
    rec(x,y);
    if a[x,y]=1 then WriteLn('BitLGM')
    else WriteLn('BitAryo');
    end
    else if n=1 then begin read(x); if x>0 then WriteLn('BitAryo') else WriteLn('BitLGM'); end
    else
     begin
       Read(n,x,y);
       if (n xor x) xor y>0 then WriteLn('BitLGM')
       else WriteLn('BitAryo');
     end;
  end.

Uses math;
Var n,x,y:LongInt;
    a:Array[0..400,0..400] of Longint;
Procedure rec(x,y:LongInt);
Var t,i:LongInt;
 begin
   For i:=1 to x do
    if (a[x-i,y]=2) then begin a[x,y]:=1; exit; end
    else begin rec(x-i,y); a[x,y]:=(a[x-i,y] mod 2)+1; exit; end;
   For i:=1 to y do
    if (a[x,y-i]=2) then begin a[x,y-i]:=1; exit; end
    else begin rec(x,y-i);  a[x,y]:=(a[x,y-i] mod 2)+1; exit; end;
   t:=min(x,y);
   For i:=1 to t do
   if a[x-i,y-i]=2 then begin a[x-i,y-i]:=1; exit; end
   else begin rec(x-i,y-i); a[x,y]:=(a[x-i,y-i] mod 2)+1; exit; end;
 end;
  begin
    Read(n);
    if n=2 then
    begin
    Read(x,y);
    a[0,0]:=1;
    rec(x,y);
    if a[x,y]=1 then WriteLn('BitLGM')
    else WriteLn('BitAryo');
    end
    else if n=1 then begin read(x); if x>0 then WriteLn('BitAryo') else WriteLn('BitLGM'); end
    else
     begin
       Read(n,x,y);
       if (n xor x) xor y>0 then WriteLn('BitLGM')
       else WriteLn('BitAryo');
     end;
  end.

Uses math;
Var n,x,y:LongInt;
    a:Array[0..400,0..400] of Longint;
Procedure rec(x,y:LongInt);
Var t,i:LongInt;
 begin
   For i:=1 to x do
    begin
      if a[x-i,y]=0 then rec(x-i,y);
      if (a[x-i,y]=2) then begin a[x,y]:=1; exit; end;
    end;
   For i:=1 to y do
    begin
      if a[x,y-i]=0 then rec(x,y-i);
      if (a[x,y-i]=2) then begin a[x,y-i]:=1; exit; end;
    end;
   t:=min(x,y);
   For i:=1 to t do
     begin
       if a[x-i,y-i]=0 then rec(x-i,y-i);
       if a[x-i,y-i]=2 then begin a[x-i,y-i]:=1; exit; end;
     end;
   a[x,y]:=2;
 end;
  begin
    Read(n);
    if n=2 then
    begin
    Read(x,y);
    rec(x,y);
    if a[x,y]=2 then WriteLn('BitLGM')
    else WriteLn('BitAryo');
    end
    else if n=1 then begin read(x); if x>0 then WriteLn('BitAryo') else WriteLn('BitLGM'); end
    else
     begin
       Read(n,x,y);
       if (n xor x) xor y>0 then WriteLn('BitLGM')
       else WriteLn('BitAryo');
     end;
  end.

uses math;
var
s:string;
dp:array[0..301,0..301]of longint;
st,m,t,n,i:longint;
b,a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x=0)and(y=0) then exit(false);
 if (x=y)and(st=2) then exit(true);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  for i:=1 to n do
   read(a[i]);
  t:=0;
  for i:=1 to n do
   if a[i]>0 then
    begin
     inc(t);
     b[t]:=a[i];
    end;
  st:=n;
  n:=t;
  for i:=1 to n do
   a[i]:=b[i];
  if n=0 then  writeln('BitAryo')
  else
  if n=1 then writeln('BitLGM')
  else
   begin
    if n=2 then
     begin
       if (a[1]=a[2])and(st=2) then writeln('BitLGM')
       else if win(a[1],a[2]) then writeln('BitLGM')
       else writeln('BitAryo');
     end
    else
     begin
       s:='BitLGM';
       t:=0;
       m:=min(a[1],min(a[2],a[3]));
       b[1]:=a[1]-m;
       b[2]:=a[2]-m;
       b[3]:=a[3]-m;
       for i:=1 to 3 do
        if b[i]>0 then
         begin
          inc(t);
          b[t]:=b[i];
         end;
       if t=0 then writeln('BitLGM')
       else
       if (a[1]=a[2])and(a[2]=a[3]) then writeln(s)
       else
       if not win(a[1],a[3]) then writeln(s)
       else if not win(a[1],a[2]) then writeln(s)
       else if not win(a[2],a[3]) then writeln(s)
       else
        begin
         if t>1 then
          begin
           if not win(b[1],b[2]) then writeln(s)
           else writeln('BitAryo');

          end
         else
          writeln('BitAryo');
        end;
     end;
   end;
 end.

uses math;
var
s:string;
dp:array[0..301,0..301]of longint;
m,t,n,i:longint;
b,a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x=0)and(y=0) then exit(false);
 if (x=y) then exit(true);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  for i:=1 to n do
   read(a[i]);
  t:=0;
  for i:=1 to n do
   if a[i]>0 then
    begin
     inc(t);
     b[t]:=a[i];
    end;
  n:=t;
  for i:=1 to n do
   a[i]:=b[i];
  if n=0 then  writeln('BitAryo')
  else
  if n=1 then writeln('BitLGM')
  else
   begin
    if n=2 then
     begin
       if (a[1]=a[2]) then writeln('BitLGM')
       else if win(a[1],a[2]) then writeln('BitLGM')
       else writeln('BitAryo');
     end
    else
     begin
       s:='BitLGM';
      m:=min(a[1],min(a[2],a[3]));
      a[1]:=a[1]-m;
      a[2]:=a[2]-m;
      a[3]:=a[3]-m;
      for i:=1 to 3 do
       if a[i]>0 then
        begin
         inc(t);
         b[t]:=a[i];
        end;
      if (a[1]=a[2])and(a[2]=a[3]) then writeln(s)
      else
      if not win(a[1],a[3]) then writeln(s)
      else if not win(a[1],a[2]) then writeln(s)
      else if not win(a[2],a[3]) then writeln(s)
      else
       begin
        if t>1 then
         begin
          if not win(b[1],b[2]) then writeln(s)
          else     writeln('BitAryo');

         end
        else
        writeln('BitAryo');
       end;
     end;
   end;
 end.

uses math;
var
s:string;
dp:array[0..301,0..301]of longint;
m,t,n,i:longint;
b,a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x=0)and(y=0) then exit(false);
 if (x=y) then exit(true);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  for i:=1 to n do
   read(a[i]);
  if n=1 then writeln('BitLGM')
  else
   begin
    if n=2 then
     begin
       if (a[1]=a[2]) then writeln('BitLGM')
       else if win(a[1],a[2]) then writeln('BitLGM')
       else writeln('BitAryo');
     end
    else
     begin
       s:='BitLGM';
      m:=min(a[1],min(a[2],a[3]));
      a[1]:=a[1]-m;
      a[2]:=a[2]-m;
      a[3]:=a[3]-m;
      for i:=1 to 3 do
       if a[i]>0 then
        begin
         inc(t);
         b[t]:=a[i];
        end;
      if (a[1]=a[2])and(a[2]=a[3]) then writeln(s)
      else
      if not win(a[1],a[3]) then writeln(s)
      else if not win(a[1],a[2]) then writeln(s)
      else if not win(a[2],a[3]) then writeln(s)
      else
       begin
        if t>1 then
         begin
          if not win(b[1],b[2]) then writeln(s)
          else     writeln('BitAryo');

         end
        else
        writeln('BitAryo');
       end;
     end;
   end;
 end.

var
s:string;
dp:array[0..301,0..301]of longint;
n,i:longint;
a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x=0)and(y=0) then exit(false);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  for i:=1 to n do
   read(a[i]);
  if n=1 then writeln('BitLGM')
  else
   begin
    if n=2 then
     begin
       if (a[1]=a[2]) then writeln('BitLGM')
       else if win(a[1],a[2]) then writeln('BitLGM')
       else writeln('BitAryo');
     end
    else
     begin
      s:='BitLGM';
      if not win(a[1],a[3]) then writeln(s)
      else if not win(a[1],a[2]) then writeln(s)
      else if not win(a[2],a[3]) then writeln(s)
      else writeln('BitAryo');
     end;
   end;
 end.

var
s:string;
dp:array[0..301,0..301]of longint;
n,i:longint;
a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x=0)and(y=0) then exit(false);
 if (x=y) then exit(true);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  for i:=1 to n do
   read(a[i]);
  if n=1 then writeln('BitLGM')
  else
   begin
    if n=2 then
     begin
       if (a[1]=a[2]) then writeln('BitLGM')
       else if win(a[1],a[2]) then writeln('BitLGM')
       else writeln('BitAryo');
     end
    else
     begin
      s:='BitLGM';
      if not win(a[1],a[3]) then writeln(s)
      else if not win(a[1],a[2]) then writeln(s)
      else if not win(a[2],a[3]) then writeln(s)
      else writeln('BitAryo');
     end;
   end;
 end.

uses math;
var
s:string;
dp:array[0..301,0..301]of longint;
m,t,n,i:longint;
b,a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x=0)and(y=0) then exit(false);
 if (x=y) then exit(true);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  for i:=1 to n do
   read(a[i]);
  t:=0;
  for i:=1 to n do
   if a[i]>0 then
    begin
     inc(t);
     b[t]:=a[i];
    end;
  n:=t;
  for i:=1 to n do
   a[i]:=b[i];
  if n=0 then  writeln('BitAryo')
  else
  if n=1 then writeln('BitLGM')
  else
   begin
    if n=2 then
     begin
       if (a[1]=a[2]) then writeln('BitLGM')
       else if win(a[1],a[2]) then writeln('BitLGM')
       else writeln('BitAryo');
     end
    else
     begin
       s:='BitLGM';
       t:=0;
       m:=min(a[1],min(a[2],a[3]));
       b[1]:=a[1]-m;
       b[2]:=a[2]-m;
       b[3]:=a[3]-m;
       for i:=1 to 3 do
        if b[i]>0 then
         begin
          inc(t);
          b[t]:=b[i];
         end;
       if t=0 then writeln('BitLGM')
       else
       if (a[1]=a[2])and(a[2]=a[3]) then writeln(s)
       else
       if not win(a[1],a[3]) then writeln(s)
       else if not win(a[1],a[2]) then writeln(s)
       else if not win(a[2],a[3]) then writeln(s)
       else
        begin
         if t>1 then
          begin
           if not win(b[1],b[2]) then writeln(s)
           else writeln('BitAryo');

          end
         else
          writeln('BitAryo');
        end;
     end;
   end;
 end.

var
s:string;
dp:array[0..301,0..301]of longint;
n,i:longint;
a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x=0)and(y=0) then exit(false);
 if (x=y) then exit(true);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  for i:=1 to n do
   read(a[i]);
  if n=1 then writeln('BitLGM')
  else
   begin
    if n=2 then
     begin
       if (a[1]=a[2]) then writeln('BitLGM')
       else if win(a[1],a[2]) then writeln('BitLGM')
       else writeln('BitAryo');
     end
    else
     begin
       s:='BitLGM';

      if (a[1]=a[2])and(a[2]=a[3]) then writeln(s)
      else
      if not win(a[1],a[3]) then writeln(s)
      else if not win(a[1],a[2]) then writeln(s)
      else if not win(a[2],a[3]) then writeln(s)
      else writeln('BitAryo');
     end;
   end;
 end.

uses math;
var
s:string;
dp:array[0..301,0..301]of longint;
m,t,n,i:longint;
b,a:array[0..10]of longint;
function win(x,y:longint):boolean;
var u:longint;
tmp:boolean;
begin
 if (x=0)and(y=0) then exit(false);
 if (x=y) then exit(true);
 if dp[x,y]=0 then
  begin
    tmp:=false;
    for u:=1 to 300 do
     begin
      if x>=u then
       begin
        if win(x-u,y)=false then tmp:=true;
       end;
      if y>=u then
       begin
        if win(x,y-u)=false then tmp:=true;
       end;
     end;
    if tmp then dp[x,y]:=1
    else dp[x,y]:=2;
  end;
 if dp[x,y]=1 then win:=true
 else win:=false;
end;
 begin
  readln(n);
  for i:=1 to n do
   read(a[i]);
  t:=0;
  for i:=1 to n do
   if a[i]>0 then
    begin
     inc(t);
     b[t]:=a[i];
    end;
  n:=t;
  for i:=1 to n do
   a[i]:=b[i];
  if n=0 then  writeln('BitAryo')
  else
  if n=1 then writeln('BitLGM')
  else
   begin
    if n=2 then
     begin
       if (a[1]=a[2]) then writeln('BitLGM')
       else if win(a[1],a[2]) then writeln('BitLGM')
       else writeln('BitAryo');
     end
    else
     begin
       s:='BitLGM';
       m:=min(a[1],min(a[2],a[3]));
       b[1]:=a[1]-m;
       b[2]:=a[2]-m;
       b[3]:=a[3]-m;
       for i:=1 to 3 do
        if b[i]>0 then
         begin
          inc(t);
          b[t]:=b[i];
         end;
       if t=0 then writeln('BitLGM')
       else
       if (a[1]=a[2])and(a[2]=a[3]) then writeln(s)
       else
       if not win(a[1],a[3]) then writeln(s)
       else if not win(a[1],a[2]) then writeln(s)
       else if not win(a[2],a[3]) then writeln(s)
       else
        begin
         if t>1 then
          begin
           if not win(b[1],b[2]) then writeln(s)
           else writeln('BitAryo');

          end
         else
          writeln('BitAryo');
        end;
     end;
   end;
 end.

var n,i,j,k,l,ww,u,v,w:longint;
   a:array[0..3]of longint;
   f:array[0..300,0..300,0..300]of longint;
function min(a,b:longint):longint;
  begin
  if a<b then exit(a);
  exit(b);
  end;
begin
  readln(n);
  for i:=1 to n do
  read(a[i]);
  if a[1]+a[2]+a[3]<>0 then
  for i:=0 to a[1] do
  for j:=0 to a[2] do
  for k:=0 to a[3] do
  if f[i,j,k]=0 then
  begin
  ww:=maxlongint;
  if a[1]<>0 then ww:=min(ww,a[1]-i);
  if a[2]<>0 then ww:=min(ww,a[2]-j);
  if a[3]<>0 then ww:=min(ww,a[3]-k);
  for l:=1 to a[1]-i do
  f[i+l,j,k]:=1;
  for l:=1to a[2]-j do
  f[i,j+l,k]:=1;
  for l:=1 to a[3]-k do
  f[i,j,k+l]:=1;
  for l:=1 to ww do
  begin
  u:=0;v:=0;w:=0;
  if a[1]<>0 then u:=i+l;
  if a[2]<>0 then v:=j+l;
  if a[3]<>0 then w:=k+l;
  f[u,v,w]:=1;
  end;
  end;
  if f[a[1],a[2],a[3]]=1 then
  writeln('BitLGM')
  else
  writeln('BitAryo');

end.

var n,i,j,k,l,ww,u,v,w:longint;
   a:array[0..3]of longint;
   f:array[0..300,0..300,0..300]of longint;
function min(a,b:longint):longint;
  begin
  if a<b then exit(a);
  exit(b);
  end;
begin
  readln(n);
  a[1]:=-1;a[2]:=-1;a[3]:=-1;
  for i:=1 to n do
  read(a[i]);
  if a[1]+a[2]+a[3]<>0 then
  for i:=0 to a[1] do
  for j:=0 to a[2] do
  for k:=0 to a[3] do
  if f[i,j,k]=0 then
  begin
  ww:=maxlongint;
  if a[1]<>-1 then ww:=min(ww,a[1]-i);
  if a[2]<>-1 then ww:=min(ww,a[2]-j);
  if a[3]<>-1 then ww:=min(ww,a[3]-k);
  for l:=1 to a[1]-i do
  f[i+l,j,k]:=1;
  for l:=1to a[2]-j do
  f[i,j+l,k]:=1;
  for l:=1 to a[3]-k do
  f[i,j,k+l]:=1;
  for l:=1 to ww do
  begin
  u:=0;v:=0;w:=0;
  if a[1]<>-1 then u:=i+l;
  if a[2]<>-1 then v:=j+l;
  if a[3]<>-1 then w:=k+l;
  f[u,v,w]:=1;
  end;
  end;
  if f[a[1],a[2],a[3]]=1 then
  writeln('BitLGM')
  else
  writeln('BitAryo');

end.

program p1;
uses math;
var n,i,j,k:integer;
a:array[0..3] of integer;
win:array[0..300,0..300] of integer;
begin
        readln(n);
        for i:=1 to n do read(a[i]);
        if (a[i]=0) and (n=1) then writeln('BitAryo');
        if (a[i]>0) and (n=1) then writeln('BitLGM');

        if n=3 then
        begin
                for i:=1 to n do n:=n xor a[i];
                if n>0 then writeln('BitLGM')
                else writeln('BitAryo');
        end;

        if n=2 then
        begin
                for i:=0 to a[1] do
                for j:=0 to a[2] do
                for k:=1 to max(i,j)do
                if ((k<=i) and (win[i-k][j]=0)) or
                        ((k<=j) and (win[i][j-k]=0)) or
                        ((k<=i) and (k<=j) and (win[i-k][j-k]=0))
                        then begin
                                win[i][j]:=1;
                                break;
                        end;
                if (win[a[1]][a[2]]=1) then writeln('BitLGM')
                else writeln('BitAryo');
        end;
end.

uses math;
var
  a:array[1..3] of longint;
  i,j,n:longint;
  first,second:string;
  f,find:array[0..300,0..300] of boolean;

procedure print(s : string);
begin
  writeln(s);
  halt;
end;

function f_2(a,b:longint) : boolean;
var
  x,y,i:longint;
  can:boolean;
begin
  x:=min(a,b);
  y:=max(a,b);
  if find[x,y] then exit(f[x,y]);
  if (x = 0) then if y <> 0 then exit(true) else exit(false);
  if (x = y) then exit(true);
  can:=false;
  for i:=1 to x do if not(f_2(x - i,y-i)) then can:=true;
  for i:=1 to x do if not(f_2(x-i,y)) then can := true;
  for i:=1 to y do if not(f_2(x,y-i)) then can := true;
  find[x,y] := true;
  f[x,y] := can;
  f_2 := can;
end;

procedure swap(var a,b:longint);
var
  c:longint;
begin
  c:=a;
  a:=b;
  b:=c;
end;

begin
  readln(n);
  for i:=1 to n do read(a[i]);
  for i:=0 to 300 do
    for j:=0 to 300 do find[i,j] := false;
  for i:=0 to 300 do
    for j:=0 to 300 do f[i,j] := false;
  for i:=1 to 300 do f[0,i] := true;
  for i:=1 to 300 do f[i,0] := true;
  for i:=3 to 300 do f[1,i] := true;
  f[1,1] := true;
  f[1,2] := false;
  for i:=1 to 300 do find[0,i] := true;
  for i:=1 to 300 do find[i,0] := true;
  for i:=3 to 300 do find[1,i] := true;
  find[1,1] := true;
  find[1,2] := true;
  first:='BitLGM';
  second:='BitAryo';
  if n = 1 then if a[1] = 0 then print(second) else print(first);
  if n = 2 then if f_2(a[1],a[2]) then print(first) else print(second);
  for i:=1 to 2 do
    for j:=i+1 to 3 do if a[i] > a[j] then swap(a[i],a[j]);
  if a[1] = 0 then if f_2(a[2],a[3]) then print(first) else print(second);
  if (a[1] = a[2]) and (a[1] = a[3]) then print(first);
  if (a[1] xor a[2] xor a[3] = 0 ) then print(SECOND) else print(first);
end.

{$r-,s-,q-,i-,o+}
{$M 10000000}
var
  f:array [0..300,0..300] of byte;
  a:array [0..100] of longint;
  n,i,j,k:longint;
  function min(a,b:longint):longint; begin if a<b then min:=a else min:=b; end;
  function max(a,b:longint):longint; begin if a>b then max:=a else max:=b; end;

  function rec(x,y:longint):longint;
    var
      ans:byte;
      i,kol,ko:longint;
    begin
      if f[x,y]<>2 then begin rec:=f[x,y]; exit; end;
      if (x=0) and (y=0) then begin rec:=0; exit; end;
      if ((x=0) and (y>0)) or ((x>0) and (y=0)) then begin rec:=1; exit; end;
      ko:=0;
      for i:=1 to min(x,y) do
        if rec(x-i,y-i)=0 then inc(ko);
      for i:=1 to max(x,y) do
        begin
          if (x>=i) and (rec(x-i,y)=0) then inc(ko);
          if (y>=i) and (rec(x,y-i)=0) then inc(ko);
        end;
      if ko>0 then ans:=1 else ans:=0;
      f[x,y]:=ans;
      rec:=ans;
    end;

begin
  randomize;
  readln(n);
  for i:=1 to n do read(a[i]);
  if n=1 then begin if a[1]>0 then writeln('BitLGM') else writeln('BitAryo'); halt(0); end;
  if n=3 then begin if a[1] xor (a[2] xor a[3])=0 then writeln('BitLGM') else writeln('BitAryo'); halt(0); end;
  for i:=0 to 300 do
    for j:=0 to 300 do
        f[i,j]:=2;
  if rec(a[1],a[2])=1
    then writeln('BitLGM')
    else writeln('BitAryo');
end.

{$r-,s-,q-,i-,o+}
{$M 10000000}
var
  f:array [0..300,0..300,0..300] of byte;
  a:array [0..100] of longint;
  n,i,j,k:longint;
  function min(a,b:longint):longint; begin if a<b then min:=a else min:=b; end;
  function max(a,b:longint):longint; begin if a>b then max:=a else max:=b; end;

  function rec(x,y,z:longint):longint;
    var
      ans:byte;
      kol,ko:longint;
    begin
      if y<0 then y:=0; if z<0 then z:=0;
      if f[x,y,z]<>2 then begin rec:=f[x,y,z]; exit; end;
      if (x=0) and (y=0) and (z=0) then begin rec:=0; exit; end;
      k:=x; if n>=2 then k:=min(k,y); if n=3 then k:=min(k,z);
      ko:=0; kol:=0;
      for i:=1 to k do
        begin
          kol:=kol+1;
          if rec(x-i,y-i,z-i)=1 then inc(ko);
        end;
      for i:=1 to max(x,max(y,z)) do
        begin
          if x>=i then begin inc(kol); if rec(x-i,y,z)=1 then inc(ko); end;
          if y>=i then begin inc(kol); if rec(x,y-i,z)=1 then inc(ko); end;
          if z>=i then begin inc(kol); if rec(x,y,z-i)=1 then inc(ko); end;
        end;
      ans:=0;
      if (ko<kol) and (kol>0) then ans:=1;
      f[x,y,z]:=ans;
      rec:=ans;
    end;

begin
  randomize;
  readln(n);
  for i:=1 to 3 do a[i]:=0;
  for i:=1 to n do read(a[i]);
  for i:=0 to 300 do
    for j:=0 to 300 do
      for k:=0 to 300 do
        f[i,j,k]:=2;
  if rec(a[1],a[2],a[3])=1
    then writeln('BitLGM')
    else writeln('BitAryo');
end.

{$r-,s-,q-,i-,o+}
{$M 10000000}
var
  f:array [0..300,0..300,0..300] of byte;
  a:array [0..100] of longint;
  n,i,j,k:longint;
  function min(a,b:longint):longint; begin if a<b then min:=a else min:=b; end;
  function max(a,b:longint):longint; begin if a>b then max:=a else max:=b; end;

  function rec(x,y,z:longint):longint;
    var
      ans:byte;
      kol,ko:longint;
    begin
      if y<0 then y:=0; if z<0 then z:=0;
      if f[x,y,z]<>2 then begin rec:=f[x,y,z]; exit; end;
      if (x=0) and (y=0) and (z=0) then begin rec:=0; exit; end;
      k:=x; if n>=2 then k:=min(k,y); if n=3 then k:=min(k,z);
      ko:=0; kol:=0;
      for i:=1 to k do
        begin
          kol:=kol+1;
          if rec(x-i,y-i,z-i)=1 then inc(ko);
        end;
      for i:=1 to max(x,max(y,z)) do
        begin
          if x>=i then begin inc(kol); if rec(x-i,y,z)=1 then inc(ko); end;
          if y>=i then begin inc(kol); if rec(x,y-i,z)=1 then inc(ko); end;
          if z>=i then begin inc(kol); if rec(x,y,z-i)=1 then inc(ko); end;
        end;
      ans:=0;
      if (ko<kol) and (kol>0) then ans:=1;
      f[x,y,z]:=ans;
      rec:=ans;
    end;

begin
  randomize;
  readln(n);
  for i:=1 to 3 do a[i]:=0;
  for i:=1 to n do read(a[i]);
  for i:=0 to 300 do
    for j:=0 to 300 do
      for k:=0 to 300 do
        f[i,j,k]:=2;
  rec(a[1],a[2],a[3]);
  if f[a[1],a[2],a[3]]=1
    then writeln('BitLGM')
    else writeln('BitAryo');
end.

{$r-,s-,q-,i-,o+}
{$M 10000000}
var
  f:array [0..300,0..300,0..300] of byte;
  a:array [0..100] of longint;
  n,i,j,k:longint;
  function min(a,b:longint):longint; begin if a<b then min:=a else min:=b; end;
  function max(a,b:longint):longint; begin if a>b then max:=a else max:=b; end;

  function rec(x,y,z:longint):longint;
    var
      ans:byte;
      i,kol,ko:longint;
    begin
      if y<0 then y:=0; if z<0 then z:=0;
      if f[x,y,z]<>2 then begin rec:=f[x,y,z]; exit; end;
      if (x=0) and (y=0) and (z=0) then begin rec:=0; exit; end;
      k:=0;
      if (x<>0) and (n>=1) then inc(k);
      if (y<>0) and (n>=2) then inc(k);
      if (z<>0) and (n>=3) then inc(k);
      if (k=1) then begin rec:=1; exit; end;
      k:=x; if n>=2 then k:=min(k,y); if n=3 then k:=min(k,z);
      ko:=0; kol:=0;
      for i:=1 to k do
        begin
          kol:=kol+1;
          if rec(x-i,y-i,z-i)=1 then inc(ko);
        end;
      for i:=1 to max(x,max(y,z)) do
        begin
          if x>=i then begin inc(kol); if rec(x-i,y,z)=1 then inc(ko); end;
          if y>=i then begin inc(kol); if rec(x,y-i,z)=1 then inc(ko); end;
          if z>=i then begin inc(kol); if rec(x,y,z-i)=1 then inc(ko); end;
        end;
      ans:=0;
      if (ko>0) and (kol>0) then ans:=1;
      f[x,y,z]:=ans;
      rec:=ans;
    end;

begin
  randomize;
  readln(n);
  for i:=1 to 3 do a[i]:=0;
  for i:=1 to n do read(a[i]);
  for i:=0 to 300 do
    for j:=0 to 300 do
      for k:=0 to 300 do
        f[i,j,k]:=2;
  if rec(a[1],a[2],a[3])=1
    then writeln('BitLGM')
    else writeln('BitAryo');
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[1]<=2) then wr (1);
    if (a[2]-a[1]<=1) then wr (1);
    if a[1]>=4 then wr (1);
    wr (0);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);

if (a[1]=0) and (a[2]>=2)  then wr (0);
wr (1);
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (i,j:longint);
var x:longint;
begin
     x:=a[i];a[i]:=a[j];a[j]:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (i,j);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[1]>=3) then wr (0);
    wr (1);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);
if (a[1]=0) and (a[2]>=2) then wr (0);
wr (1);
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (i,j:longint);
var x:longint;
begin
     x:=a[i];a[i]:=a[j];a[j]:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (i,j);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[1]>=3) and (a[1] mod 2=1) and (a[2]=a[1]+1) then wr (0);
    wr (1);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);
if (a[1]=0) and (a[2]>=2) then wr (0);
wr (1);
end.

uses math;
var a:array [0..3000000] of longint;
    i,j,x,n,o:longint;ans:longint;
    s1,s2:ansistring;
procedure swap (var i,j:longint);
var x:longint;
begin
     x:=i;i:=j;j:=x;
end;
procedure qsort (l,r:longint);
var i,j,x:longint;
begin
   i:=l;
   j:=r;
   x:=a[(l+r) div 2];
   repeat
       while x>a[i] do inc (i);
       while x<a[j] do dec (j);
       if i<=j then begin swap (a[i],a[j]);inc (i);dec (j);end;
   until i>j;
   if i<r then qsort (i,r);
   if l<j then qsort (l,j);
end;
procedure wr (x:longint);
  begin
    if x=0 then
      writeln ('BitAryo') else writeln ('BitLGM');
    halt;
  end;

begin            {
assign (input,'input.txt');
assign (output,'output.txt');
reset (input);
rewrite (output);  }
readln (n);
for i:=1 to n do read (a[i]);
if n=1 then
  wr (1);
if n=2 then
  begin
    if a[1]>a[2] then swap (a[1],a[2]);
    if (a[1]=0) and (a[2]=0) then
      wr (0);
    if (a[1]=1) and (a[2]=2) then wr (0);
    if (a[1]<=2) then wr (1);
    if (a[2]-a[1]<=1) then wr (1);
    wr (0);
  end;
if (a[1]+a[2]+a[3]=0) then wr (0);
qsort (1,3);
if (a[1]=0) and (a[2]=1) and (a[3]=1) then wr (0);
if (a[1]=0) and (a[2]>=2) and (a[3]<>a[2]) then wr (0);
wr (1);
end.

var f2:array[0..301,0..301] of longint;
    f3:array[0..301,0..301,0..301] of longint;
    maxx:array[0..333,0..333] of longint;
    minn:array[0..333,0..333] of longint;
    n,m,i,j,k:longint;
    a:array[0..40] of longint;
    first,second:string;

function min(a,b:longint):longint;
begin
 if a<b then min:=a else min:=b;
end;

function max(a,b:longint):longint;
begin
 if a>B then max:=a else max:=b;
end;

procedure two;
var i,j,k:longint;
begin
 for i:= 0 to 300 do
  for j:= 0 to 300 do
   begin
    if (i=0) and (j=0) then f2[i][j]:=0 else
    begin
     for k:= 1 to maxx[i,j] do
     begin
      if (i>=k) and (j>=k) and (f2[i-k][j-k] = 0) then f2[i][j]:=1;
      if (i>=k) and (f2[i-k][j] = 0) then f2[i][j]:=1;
      if (j>=k) and (f2[i][j-k] = 0) then f2[i][j]:=1;
     end;
    end;
   end;
end;

procedure swap(var t,y:longint);
var u:longint;
begin
 u:=t; t:=y; y:=u;
end;

procedure three;
var i,j,k,t:longint;
    used:boolean;
begin
 for i:= 0 to 300 do
  for j:= i to 300 do
   for k:= j to 300 do
    begin
     used:=false;
     for t:= 1 to i do
      if f3[i-t][j-t][k-t] = 0 then
       begin
        used:=true;
        break;
       end;
      if used then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
      for t:= 1 to maxx[maxx[i,j],k] do
       if (i>=t) and (f3[i-t][j][k]=0) then
        begin
         used:=true;
         break;
        end else
       if (j>=t) and (f3[minn[i,j-t]][maxx[i,j-t]][k]=0) then
        begin
         used:=true;
         break;
        end else
       if (k>=t) and (f3[minn[i,k-t]][minn[j,k-t]][maxx[k,k-t]]=0) then
        begin
         used:=true;
         break;
        end;
      if used then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
    end;
end;

begin
 first:='BitLGM';
 second:='BitAryo';
 readln(n);
 for i:= 1 to n do read(a[i]);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   maxx[i][j]:=max(i,j);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   minn[i][j]:=min(i,j);
 if n = 1 then
  begin
   if a[i]=0 then writeln(second) else writeln(first);
   halt;
  end;
 two;
 if n = 2 then
  begin
   if f2[a[1],a[2]]=1 then writeln(first) else writeln(second);
   halt;
  end;
 if a[1]>a[2] then swap(a[1],a[2]);
 if a[2]>a[3] then swap(a[2],a[3]);
 if a[1]>a[2] then swap(a[1],a[2]);
 three;
 if f3[a[1],a[2],a[3]]=1 then writeln(first) else writeln(second);
end.

var f2:array[0..301,0..301] of longint;
    f3:array[0..301,0..301,0..301] of longint;
    maxx:array[0..333,0..333] of longint;
    minn:array[0..333,0..333] of longint;
    n,m,i,j,k,q1,q2,q3:longint;
    a:array[0..40] of longint;
    first,second:string;

function min(a,b:longint):longint;
begin
 if a<b then min:=a else min:=b;
end;

function max(a,b:longint):longint;
begin
 if a>B then max:=a else max:=b;
end;

procedure two;
var i,j,k:longint;
begin
 for i:= 0 to 300 do
  for j:= 0 to 300 do
   begin
    if (i=0) and (j=0) then f2[i][j]:=0 else
    begin
     for k:= 1 to maxx[i,j] do
     begin
      if (i>=k) and (j>=k) and (f2[i-k][j-k] = 0) then f2[i][j]:=1;
      if (i>=k) and (f2[i-k][j] = 0) then f2[i][j]:=1;
      if (j>=k) and (f2[i][j-k] = 0) then f2[i][j]:=1;
     end;
    end;
   end;
end;

procedure swap(var t,y:longint);
var u:longint;
begin
 u:=t; t:=y; y:=u;
end;

procedure three;
var i,j,k,t:longint;
    used:boolean;
begin
 for i:= 0 to 300 do
  for j:= i to 300 do
   for k:= j to 300 do
    begin

     used:=false;
     for t:= 1 to i do
      if f3[i-t][j-t][k-t] = 0 then
       begin
        used:=true;
        break;
       end;
      if used then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
     { for t:= 1 to maxx[maxx[i,j],k] do
       if (i>=t) and (f3[i-t][j][k]=0) then
        begin
         used:=true;
         break;
        end else
       if (j>=t) and (f3[minn[i,j-t]][maxx[i,j-t]][k]=0) then
        begin
         used:=true;
         break;
        end else
       if (k>=t) then
        begin
         q1:=i;
         q2:=j;
         q3:=k-t;
         if (q2>q3) then swap(q2,q3);
         if (q1>q2) then swap(q1,q2);
         if f3[q1][q2][q3]=0 then
          begin
           used:=true;
           break;
          end;
        end;}
      if used then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
    end;
end;

begin
 first:='BitLGM';
 second:='BitAryo';
 readln(n);
 for i:= 1 to n do read(a[i]);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   maxx[i][j]:=max(i,j);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   minn[i][j]:=min(i,j);
 if n = 1 then
  begin
   if a[1]=0 then writeln(second) else writeln(first);
   halt;
  end;
 two;
 if n = 2 then
  begin
   if f2[a[1],a[2]]=1 then writeln(first) else writeln(second);
   halt;
  end;
 if a[1]>a[2] then swap(a[1],a[2]);
 if a[2]>a[3] then swap(a[2],a[3]);
 if a[1]>a[2] then swap(a[1],a[2]);
 three;
 if f3[a[1],a[2],a[3]]=1 then writeln(first) else writeln(second);
end.

var f2:array[0..301,0..301] of longint;
    f3:array[0..301,0..301,0..301] of longint;
    maxx:array[0..333,0..333] of longint;
    minn:array[0..333,0..333] of longint;
    n,m,i,j,k,q1,q2,q3:longint;
    a:array[0..40] of longint;
    first,second:string;

function min(a,b:longint):longint;
begin
 if a<b then min:=a else min:=b;
end;

function max(a,b:longint):longint;
begin
 if a>B then max:=a else max:=b;
end;

procedure two;
var i,j,k:longint;
begin
 for i:= 0 to 300 do
  for j:= 0 to 300 do
   begin
    if (i=0) and (j=0) then f2[i][j]:=0 else
    begin
     for k:= 1 to maxx[i,j] do
     begin
      if (i>=k) and (j>=k) and (f2[i-k][j-k] = 0) then f2[i][j]:=1;
      if (i>=k) and (f2[i-k][j] = 0) then f2[i][j]:=1;
      if (j>=k) and (f2[i][j-k] = 0) then f2[i][j]:=1;
     end;
    end;
   end;
end;

procedure swap(var t,y:longint);
var u:longint;
begin
 u:=t; t:=y; y:=u;
end;

procedure three;
var i,j,k,t:longint;
    used:boolean;
begin
 for i:= 0 to 300 do
  for j:= i to 300 do
   for k:= j to 300 do
    begin
     if (i=j) or (i=k) or (j=k) then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
     used:=false;
     for t:= 1 to i do
      if f3[i-t][j-t][k-t] = 0 then
       begin
        used:=true;
        break;
       end;
      if used then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
     { for t:= 1 to maxx[maxx[i,j],k] do
       if (i>=t) and (f3[i-t][j][k]=0) then
        begin
         used:=true;
         break;
        end else
       if (j>=t) and (f3[minn[i,j-t]][maxx[i,j-t]][k]=0) then
        begin
         used:=true;
         break;
        end else
       if (k>=t) then
        begin
         q1:=i;
         q2:=j;
         q3:=k-t;
         if (q2>q3) then swap(q2,q3);
         if (q1>q2) then swap(q1,q2);
         if f3[q1][q2][q3]=0 then
          begin
           used:=true;
           break;
          end;
        end;}
      if used then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
    end;
end;

begin
 first:='BitLGM';
 second:='BitAryo';
 readln(n);
 for i:= 1 to n do read(a[i]);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   maxx[i][j]:=max(i,j);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   minn[i][j]:=min(i,j);
 if n = 1 then
  begin
   if a[1]=0 then writeln(second) else writeln(first);
   halt;
  end;
 two;
 if n = 2 then
  begin
   if f2[a[1],a[2]]=1 then writeln(first) else writeln(second);
   halt;
  end;
 if a[1]>a[2] then swap(a[1],a[2]);
 if a[2]>a[3] then swap(a[2],a[3]);
 if a[1]>a[2] then swap(a[1],a[2]);
 three;
 if f3[a[1],a[2],a[3]]=1 then writeln(first) else writeln(second);
end.

var f2:array[0..301,0..301] of longint;
    f3:array[0..301,0..301,0..301] of longint;
    maxx:array[0..333,0..333] of longint;
    minn:array[0..333,0..333] of longint;
    n,m,i,j,k:longint;
    a:array[0..40] of longint;
    first,second:string;

function min(a,b:longint):longint;
begin
 if a<b then min:=a else min:=b;
end;

function max(a,b:longint):longint;
begin
 if a>B then max:=a else max:=b;
end;

procedure two;
var i,j,k:longint;
begin
 for i:= 0 to 300 do
  for j:= 0 to 300 do
   begin
    if (i=0) and (j=0) then f2[i][j]:=0 else
    begin
     for k:= 1 to maxx[i,j] do
     begin
      if (i>=k) and (j>=k) and (f2[i-k][j-k] = 0) then f2[i][j]:=1;
      if (i>=k) and (f2[i-k][j] = 0) then f2[i][j]:=1;
      if (j>=k) and (f2[i][j-k] = 0) then f2[i][j]:=1;
     end;
    end;
   end;
end;

procedure swap(var t,y:longint);
var u:longint;
begin
 u:=t; t:=y; y:=u;
end;

procedure three;
var i,j,k,t:longint;
    used:boolean;
begin
 for i:= 0 to 300 do
  for j:= i to 300 do
   for k:= j to 300 do
    begin
     used:=false;
     for t:= 1 to i do
      if f3[i-t][j-t][k-t] = 0 then
       begin
        used:=true;
        break;
       end;
      if used then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
      for t:= 1 to maxx[maxx[i,j],k] do
       if (i>=t) and (f3[i-t][j][k]=0) then
        begin
         used:=true;
         break;
        end else
       if (j>=t) and (f3[minn[i,j-t]][maxx[i,j-t]][k]=0) then
        begin
         used:=true;
         break;
        end else
       if (k>=t) and (f3[minn[i,k-t]][minn[j,k-t]][maxx[k,k-t]]=0) then
        begin
         used:=true;
         break;
        end;
      if used then
       begin
        f3[i][j][k]:=1;
        continue;
       end;
    end;
end;

begin
 first:='BitLGM';
 second:='BitAryo';
 readln(n);
 for i:= 1 to n do read(a[i]);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   maxx[i][j]:=max(i,j);
 for i:= 0 to 333 do
  for j:= 0 to 333 do
   minn[i][j]:=min(i,j);
 if n = 1 then
  begin
   if a[1]=0 then writeln(second) else writeln(first);
   halt;
  end;
 two;
 if n = 2 then
  begin
   if f2[a[1],a[2]]=1 then writeln(first) else writeln(second);
   halt;
  end;
 if a[1]>a[2] then swap(a[1],a[2]);
 if a[2]>a[3] then swap(a[2],a[3]);
 if a[1]>a[2] then swap(a[1],a[2]);
 three;
 if f3[a[1],a[2],a[3]]=1 then writeln(first) else writeln(second);
end.

Uses math;
Var m:array [0..300,0..300] of boolean;
rez:array [1..10000] of Boolean;
m1:array [0..300,0..300,0..300] of boolean;
c,i1,kol,n,z,a,b,i,j:LongInt;
f:boolean;
procedure probeg(a,b:longint);
begin
        if (a=0)and(b=0)
        then begin writeln('BitAryo'); Halt(0); end;
        if (a=0)or(b=0)
        then begin writeln('BitLGM'); Halt(0); end;
        if a=b
        then begin writeln('BitLGM'); Halt(0); end;
        kol:=0;
        FillChar(m,SizeOf(m),true);
        for i:=1 to 300 do
        begin
          if not rez[i]
          then begin
                Inc(kol);
                if i+kol>300
                then Break;
                m[i,i+kol]:=false;
                m[i+kol,i]:=false;
                rez[i]:=true;
                rez[i+kol]:=true;
               end;
        end;
        if not m[a,b]
        then writeln('BitAryo')
        else Writeln('BitLGM');
  Halt(0);
end;
begin
 // Assign(input,'input.txt'); reset(input);
 // Assign(output,'output.txt'); rewrite(output);
  readln(n);
  if n=1
  then begin
        read(a);
        if a<>0
        then writeln('BitLGM')
        else writeln('BitAryo');
         Halt(0);
       end;
  if n=2
  then begin
        Readln(a,b);
        if (a=0)and(b=0)
        then begin writeln('BitAryo'); Halt(0); end;
        if (a=0)or(b=0)
        then begin writeln('BitLGM'); Halt(0); end;
        if a=b
        then begin writeln('BitLGM'); Halt(0); end;
        kol:=0;
        FillChar(m,SizeOf(m),true);
        for i:=1 to 300 do
        begin
          if not rez[i]
          then begin
                Inc(kol);
                if i+kol>300
                then Break;
                m[i,i+kol]:=false;
                m[i+kol,i]:=false;
                rez[i]:=true;
                rez[i+kol]:=true;
               end;
        end;
        if not m[a,b]
        then writeln('BitAryo')
        else Writeln('BitLGM');
       end
  else begin
        readln(a,b,c);
        if c=0
        then probeg(a,b);
        if b=0
        then probeg(a,c);
        if a=0
        then probeg(b,c);
        if (a=b)or(b=c)or(a=c)
        then begin Writeln('BitLGM'); halt(0); end;
        if (a<=b)and(a<=c)
        then begin
              if abs(b-c)=a
              then writeln('BitAryo')
              else Writeln('BitLGM');
              halt(0);
             end;
        if (b<=c)and(b<=a)
        then begin
              if Abs(a-c)=b
              then writeln('BitAryo')
              else Writeln('BitLGM');
              halt(0);
             end;
        if (c<=a)and(c<=b)
        then begin
              if Abs(a-b)=c
              then writeln('BitAryo')
              else Writeln('BitLGM');
              halt(0);
             end;
{        m1[0,0,0]:=false;
        for i:=0 to a do
        for j:=0 to b do
        for i1:=0 to c do
        begin
          f:=false;
          for z:=1 to min(i,min(j,i1)) do
          if not m1[i-z,j-z,i1-z]
          then f:=true;
          for z:=1 to i do
          if not m1[i-z,j,i1]
          then f:=true;
          for z:=1 to j do
          if not m1[i,j-z,i1]
          then f:=true;
          for z:=1 to i1 do
          if not m1[i,j,i1-z]
          then f:=true;
          m1[i,j,i1]:=f;
        end;
        for i:=1 to a do
        for j:=1 to b do
        for i1:=1 to c do
        if not m1[i,j,i1]
        then writeln(i,' ',j,' ',i1);}
       end;
end.

Uses math;
//const zz:array [1..3,1..11785] of longint=();
Var m:array [0..300,0..300] of boolean;
zz:array[1..300] of longint;
rez:array [1..10000] of Boolean;
m1:array [0..300,0..300,0..300] of boolean;
used:array [0..300,0..300,0..300] of Boolean;
c,i1,kol,n,z,a,b,i,j:LongInt;
f:boolean;
procedure swap(var a,b:longint);
var x:longint;
begin
  x:=a; a:=b; b:=x;
end;
function probeg2(a,b,c:longint):boolean;
Var i:longint;
begin
  if used[a,b,c]
  then begin probeg2:=m1[a,b,c]; Exit; end;
  used[a,b,c]:=true;
  used[b,c,a]:=true;
  used[a,c,b]:=true;
  used[b,a,c]:=True;
  used[c,a,b]:=true;
  used[c,b,a]:=true;
  m1[a,b,c]:=False;
  for i:=min(a,Min(b,c)) downto 1 do
  if not probeg2(a-i,b-i,c-i)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;

  for i:=a downto 1 do
  if not probeg2(a-i,b,c)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  for i:=b downto 1 do
  if not probeg2(a,b-i,c)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  for i:=c downto 1 do
  if not probeg2(a,b,c-i)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  probeg2:=false;
end;
procedure probeg(a,b:longint);
begin
        if (a=0)and(b=0)
        then begin writeln('BitAryo'); Halt(0); end;
        if (a=0)or(b=0)
        then begin writeln('BitLGM'); Halt(0); end;
        if a=b
        then begin writeln('BitLGM'); Halt(0); end;
        kol:=0;
        FillChar(m,SizeOf(m),true);
        for i:=1 to 300 do
        begin
          if not rez[i]
          then begin
                Inc(kol);
                if i+kol>300
                then Break;
                m[i,i+kol]:=false;
                m[i+kol,i]:=false;
                rez[i]:=true;
                rez[i+kol]:=true;
               end;
        end;
        if not m[a,b]
        then writeln('BitAryo')
        else Writeln('BitLGM');
  Halt(0);
end;
function stepen(x:longint):boolean;
begin
  while x>1 do
  begin
    if x mod 2=1
    then begin stepen:=false; exit; end;
    x:=x div 2;
  end;
  stepen:=true;
end;
procedure zapoln(a,b,c:longint);
begin
  m1[a,b,c]:=true; used[a,b,c]:=true;
  m1[b,c,a]:=true; used[b,c,a]:=true;
  m1[a,c,b]:=true; used[a,c,b]:=true;
  m1[b,a,c]:=true; used[b,a,c]:=True;
  m1[c,a,b]:=true; used[c,a,b]:=true;
  m1[c,b,a]:=true; used[c,b,a]:=true;
end;
begin
 // Assign(input,'input.txt'); reset(input);
 // Assign(output,'output.txt'); rewrite(output);
  readln(n);
  if n=1
  then begin
        read(a);
        if a<>0
        then writeln('BitLGM')
        else writeln('BitAryo');
         Halt(0);
       end;
  if n=2
  then begin
        Readln(a,b);
        if (a=0)and(b=0)
        then begin writeln('BitAryo'); Halt(0); end;
        if (a=0)or(b=0)
        then begin writeln('BitLGM'); Halt(0); end;
        if a=b
        then begin writeln('BitLGM'); Halt(0); end;
        kol:=0;
        FillChar(m,SizeOf(m),true);
        for i:=1 to 300 do
        begin
          if not rez[i]
          then begin
                Inc(kol);
                if i+kol>300
                then Break;
                m[i,i+kol]:=false;
                m[i+kol,i]:=false;
                rez[i]:=true;
                rez[i+kol]:=true;
               end;
        end;
        if not m[a,b]
        then writeln('BitAryo')
        else Writeln('BitLGM');
       end
  else begin
        readln(a,b,c);
        if c=0
        then probeg(a,b);
        if b=0
        then probeg(a,c);
        if a=0
        then probeg(b,c);
        if (a=b)or(b=c)or(a=c)
        then begin Writeln('BitLGM'); halt(0); end;
        m1[0,0,0]:=false;
        used[0,0,0]:=true;
        for i:=0 to 300 do
        for j:=0 to 300 do
        for i1:=0 to 300 do
        begin
         if not used[i,j,i1]
         then begin
                //m1[i,j,i1]:=probeg2(i,j,i1);
                if m1[a,b,c]=False
                then begin
                      for z:=300-Max(i,Max(j,i1)) downto 1 do
                      zapoln(i+z,j+z,i1+z);
                      for z:=i+1 to 300 do
                      zapoln(z,j,i1);
                      for z:=j+1 to 300 do
                      zapoln(i,z,i1);
                      for z:=j+1 to 300 do
                      zapoln(i,z,i1);
                     end;
              end;
        end;
        if not m1[a,b,c]
        then writeln('BitAryo')
        else Writeln('BitLGM');
{        m1[0,0,0]:=false;
        for i:=0 to a do
        for j:=0 to b do
        for i1:=0 to c do
        begin
          f:=false;
          for z:=1 to min(i,min(j,i1)) do
          if not m1[i-z,j-z,i1-z]
          then f:=true;
          for z:=1 to i do
          if not m1[i-z,j,i1]
          then f:=true;
          for z:=1 to j do
          if not m1[i,j-z,i1]
          then f:=true;
          for z:=1 to i1 do
          if not m1[i,j,i1-z]
          then f:=true;
          m1[i,j,i1]:=f;
        end;
        for i:=1 to a do
        begin
          f:=false;
          for j:=i to b do
          for i1:=j to c do
          if not m1[i,j,i1]
          then writeln(i,' ',j,' ',i1,',');
        end;}
       end;
end.

Uses math;
//const zz:array [1..3,1..11785] of longint=();
Var m:array [0..300,0..300] of boolean;
zz:array[1..300] of longint;
rez:array [1..10000] of Boolean;
m1:array [0..300,0..300,0..300] of boolean;
used:array [0..300,0..300,0..300] of Boolean;
c,i1,kol,n,z,a,b,i,j:LongInt;
f:boolean;
procedure swap(var a,b:longint);
var x:longint;
begin
  x:=a; a:=b; b:=x;
end;
function probeg2(a,b,c:longint):boolean;
Var i:longint;
begin
  if used[a,b,c]
  then begin probeg2:=m1[a,b,c]; Exit; end;
  used[a,b,c]:=true;
  used[b,c,a]:=true;
  used[a,c,b]:=true;
  used[b,a,c]:=True;
  used[c,a,b]:=true;
  used[c,b,a]:=true;
  m1[a,b,c]:=False;
  for i:=min(a,Min(b,c)) downto 1 do
  if not probeg2(a-i,b-i,c-i)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;

  for i:=a downto 1 do
  if not probeg2(a-i,b,c)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  for i:=b downto 1 do
  if not probeg2(a,b-i,c)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  for i:=c downto 1 do
  if not probeg2(a,b,c-i)
  then begin m1[a,b,c]:=true; used[a,b,c]:=true;
             m1[b,c,a]:=true; used[b,c,a]:=true;
             m1[a,c,b]:=true; used[a,c,b]:=true;
             m1[b,a,c]:=true; used[b,a,c]:=True;
             m1[c,a,b]:=true; used[c,a,b]:=true;
             m1[c,b,a]:=true; used[c,b,a]:=true;
   probeg2:=true; exit; end;
  probeg2:=false;
end;
procedure probeg(a,b:longint);
begin
        if (a=0)and(b=0)
        then begin writeln('BitAryo'); Halt(0); end;
        if (a=0)or(b=0)
        then begin writeln('BitLGM'); Halt(0); end;
        if a=b
        then begin writeln('BitLGM'); Halt(0); end;
        kol:=0;
        FillChar(m,SizeOf(m),true);
        for i:=1 to 300 do
        begin
          if not rez[i]
          then begin
                Inc(kol);
                if i+kol>300
                then Break;
                m[i,i+kol]:=false;
                m[i+kol,i]:=false;
                rez[i]:=true;
                rez[i+kol]:=true;
               end;
        end;
        if not m[a,b]
        then writeln('BitAryo')
        else Writeln('BitLGM');
  Halt(0);
end;
function stepen(x:longint):boolean;
begin
  while x>1 do
  begin
    if x mod 2=1
    then begin stepen:=false; exit; end;
    x:=x div 2;
  end;
  stepen:=true;
end;
procedure zapoln(a,b,c:longint);
begin
  m1[a,b,c]:=true; used[a,b,c]:=true;
{  m1[b,c,a]:=true; used[b,c,a]:=true;
  m1[a,c,b]:=true; used[a,c,b]:=true;
  m1[b,a,c]:=true; used[b,a,c]:=True;
  m1[c,a,b]:=true; used[c,a,b]:=true;
  m1[c,b,a]:=true; used[c,b,a]:=true;}
end;
begin
//  Assign(input,'input.txt'); reset(input);
//  Assign(output,'output.txt'); rewrite(output);
  readln(n);
  if n=1
  then begin
        read(a);
        if a<>0
        then writeln('BitLGM')
        else writeln('BitAryo');
         Halt(0);
       end;
  if n=2
  then begin
        Readln(a,b);
        if (a=0)and(b=0)
        then begin writeln('BitAryo'); Halt(0); end;
        if (a=0)or(b=0)
        then begin writeln('BitLGM'); Halt(0); end;
        if a=b
        then begin writeln('BitLGM'); Halt(0); end;
        kol:=0;
        FillChar(m,SizeOf(m),true);
        for i:=1 to 300 do
        begin
          if not rez[i]
          then begin
                Inc(kol);
                if i+kol>300
                then Break;
                m[i,i+kol]:=false;
                m[i+kol,i]:=false;
                rez[i]:=true;
                rez[i+kol]:=true;
               end;
        end;
        if not m[a,b]
        then writeln('BitAryo')
        else Writeln('BitLGM');
       end
  else begin
        readln(a,b,c);
        if c=0
        then probeg(a,b);
        if b=0
        then probeg(a,c);
        if a=0
        then probeg(b,c);
        if (a=b)or(b=c)or(a=c)
        then begin Writeln('BitLGM'); halt(0); end;
        for i:=0 to 300 do
        for j:=0 to 300 do
        for i1:=0 to 300 do
        begin
         if not used[i,j,i1]
         then begin
                m1[i,j,i1]:=False;
                used[i,j,i1]:=true;
                      for z:=300-Max(i,Max(j,i1)) downto 1 do
                      zapoln(i+z,j+z,i1+z);
                      for z:=i+1 to 300 do
                      zapoln(z,j,i1);
                      for z:=j+1 to 300 do
                      zapoln(i,z,i1);
                      for z:=i1+1 to 300 do
                      zapoln(i,j,z);
              end;
        end;
        if not m1[a,b,c]
        then writeln('BitAryo')
        else Writeln('BitLGM');
{        m1[0,0,0]:=false;
        for i:=0 to a do
        for j:=0 to b do
        for i1:=0 to c do
        begin
          f:=false;
          for z:=1 to min(i,min(j,i1)) do
          if not m1[i-z,j-z,i1-z]
          then f:=true;
          for z:=1 to i do
          if not m1[i-z,j,i1]
          then f:=true;
          for z:=1 to j do
          if not m1[i,j-z,i1]
          then f:=true;
          for z:=1 to i1 do
          if not m1[i,j,i1-z]
          then f:=true;
          m1[i,j,i1]:=f;
        end;
        for i:=1 to a do
        begin
          f:=false;
          for j:=i to b do
          for i1:=j to c do
          if not m1[i,j,i1]
          then writeln(i,' ',j,' ',i1,',');
        end;}
       end;
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils, Math;

var
  i, j, k, n: integer;
  a: array[1..100] of integer;
  f: array[0..300, 0..300, 0..300] of integer;

function get(x1, x2, x3: integer): integer;
var
  i: integer;
  mex: array[0..1] of boolean;
begin
  if (f[x1][x2][x3] = -1) then begin
    for i := 1 to x1 do begin
      if (mex[0]) then
        break;
      mex[get(x1 - i, x2, x3)] := true;
    end;

    for i := 1 to x2 do begin
      if (mex[0]) then
        break;
      mex[get(x1, x2 - i, x3)] := true;
    end;

    for i := 1 to x3 do begin
      if (mex[0]) then
        break;
      mex[get(x1, x2, x3 - i)] := true;
    end;

    for i := 1 to min(min(x1, x2), x3) do begin
      if (mex[0]) then
        break;
      mex[get(x1 - i, x2 - i, x3 - i)] := true;
    end;

    if (mex[0] = false) then
      result := 0
    else
      result := 1;

    f[x1][x2][x3] := result;
    f[x1][x3][x2] := result;
    f[x2][x1][x3] := result;
    f[x2][x3][x1] := result;
    f[x3][x1][x2] := result;
    f[x3][x2][x1] := result;
  end else begin
    result := f[x1][x2][x3];
  end;
end;

function get1(x1, x2: integer): integer;
var
  i: integer;
  mex: array[0..1] of boolean;
begin
  if (f[x1][x2][0] = -1) then begin
    for i := 0 to 1 do
      mex[i] := false;
    for i := 1 to x1 do begin
      mex[get1(x1 - i, x2)] := true;
    end;

    for i := 1 to x2 do begin
      mex[get1(x1, x2 - i)] := true;
    end;

    for i := 1 to min(x1, x2) do begin
      mex[get1(x1 - i, x2 - i)] := true;
    end;

    if (mex[0] = false) then
      result := 0
    else
      result := 1;
    f[x1][x2][0] := result;
    f[x2][x1][0] := result;
  end else begin
    result := f[x1][x2][0];
  end;
end;

begin
{  reset(input, 'input.txt');
  rewrite(output, 'output.txt');}

  readln(n);

  for i := 1 to n do begin
    read(a[i]);
  end;

  for i := 0 to a[1] do
    for j := 0 to a[2] do
      for k := 0 to a[3] do
        f[i][j][k] := -1;

  if (n = 1) then begin
    if (a[1] = 0) then
      writeln('BitAryo')
    else
      writeln('BitLGM');
    halt;
  end;

  if (n = 2) then begin
    if (get1(a[1], a[2]) = 0) then
      writeln('BitAryo')
    else
      writeln('BitLGM');
    halt;
  end;

  if (get(a[1], a[2], a[3]) = 0) then
    writeln('BitAryo')
  else
    writeln('BitLGM');

{  for i := 1 to 10 do begin
    writeln(i);
    for j := 1 to 10 do begin
      for k := 1 to 10 do begin
        write((((3* i) xor (3 * j) xor (3 * k)) > 0) and (get(i, j, k) = 1));
        writeln(i, ' ', j, ' ', k);
      end;
      writeln;
    end;
    writeln;
  end;}
end.

{$R-,S-,Q-,I-,O-}
{$M 32000000}

{$APPTYPE CONSOLE}

uses Math;
const
inf = round(1e9);
maxn = round(1e5) + 200;
md = round(1e9) + 7;
var
n,i,j,k : longint;
ok : boolean;
a : array [1..3] of longint;
dp : array [0..333,0..333] of boolean;
begin
 //reset (input,'input.txt');
 //rewrite (output,'output.txt');
 randomize;
 readln(n);
 for i:=1 to n do read(a[i]);
 if n = 1 then
 begin
  if a[1] = 0 then writeln('BitAryo')
              else writeln('BitLGM');
  halt;
 end;
 if n = 2 then
 begin
  fillchar(dp,sizeof(dp),true);
  dp[0][0]:=false;
  for i:=0 to a[1] do
   for j:=0 to a[2] do
   if not((i = 0) and (j = 0)) then
   begin
    ok:=false;
    if not dp[i - min(i,j),j - min(i,j)] then ok:=true;
    for k:=1 to i do
    if not dp[i - k,j] then ok:=true;
    for k:=1 to j do
    if not dp[i,j - k] then ok:=true;
    dp[i,j]:=ok;
   end;
  if dp[a[1],a[2]] then writeln('BitLGM')
                   else writeln('BitAryo');
  halt;
 end;

 if a[1] xor a[2] xor a[3] = 0 then writeln('BitAryo')
                               else writeln('BitLGM');
end.

{$R-,S-,Q-,I-,O-}
{$M 32000000}

{$APPTYPE CONSOLE}

uses Math;
const
inf = round(1e9);
maxn = round(1e5) + 200;
md = round(1e9) + 7;
var
n,i,j,k : longint;
ok : boolean;
a : array [1..3] of longint;
dp : array [0..333,0..333] of boolean;
begin
 //reset (input,'input.txt');
 //rewrite (output,'output.txt');
 randomize;
 readln(n);
 for i:=1 to n do read(a[i]);
 if n = 1 then
 begin
  if a[1] = 0 then writeln('BitAryo')
              else writeln('BitLGM');
  halt;
 end;
 if n = 2 then
 begin
  fillchar(dp,sizeof(dp),true);
  dp[0][0]:=false;
  for i:=0 to a[1] do
   for j:=0 to a[2] do
   if not((i = 0) and (j = 0)) then
   begin
    ok:=false;
    if not dp[i - min(i,j),j - min(i,j)] then ok:=true;
    for k:=1 to a[1] do
    if not dp[i - k,j] then ok:=true;
    for k:=1 to a[2] do
    if not dp[i,j - k] then ok:=true;
    dp[i,j]:=ok;
   end;
  if dp[a[1],a[2]] then writeln('BitLGM')
                   else writeln('BitAryo');
  halt;
 end;

 if a[1] xor a[2] xor a[3] = 0 then writeln('BitAryo')
                               else writeln('BitLGM');
end.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE CONSOLE}

const file1='d.in';
      file2='d.out';
      oo=maxlongint div 2;
      empty='';
      eps=1e-6;
      dohrena=1e21;

var qc,he:array[0..2009]of longint;
    ss:array[0..2009]of string;
    qq,cc:array[0..500000]of longint;
    bb:array[0..500000]of boolean;
    xx,yy,zz:array[0..500000]of extended;
    a:array[0..331,0..331,0..331]of byte;
    y,x,ii,jj,kk,t,test,u,v,w,n,m,r,p,q,c,h,e,r0,r1,r2,res:longint;
    s,s0,s1,s2:string;
    sss:ansistring;
    z,x0,x1,x2,y0,y1,y2,z0,z1,z2:extended;
    ch:char;
    b,b0,b1,b2:boolean;

procedure clear;
var i,j,k:longint;
    begin
    end;

procedure load;
var i,j,k:longint;
    begin
    read(n);
    for i:=1 to n do read(qc[i]);
    end;

procedure save;
var i,j,k:longint;
    begin
    if res=1 then writeln('BitLGM') else writeln('BitAryo');
    end;

procedure run;
var i,j,k:longint;
    begin
    res:=0;
    if n=1 then
      begin
      res:=1;
      if qc[1]=0 then res:=2;
      end;
    if n=2 then
      begin
      if abs(qc[1]-qc[2])=1 then res:=2 else res:=1;
      if qc[1]+qc[2]<=1 then res:=1;
      end;
    if n=3 then
      begin
      a[0,0,0]:=0;
      for i:=0 to 320 do
        for j:=0 to 320 do
          for k:=0 to 320 do
            if a[i,j,k]=0 then
              begin
              for x:=i+1 to 310 do a[x,j,k]:=1;
              for x:=j+1 to 310 do a[i,x,k]:=1;
              for x:=k+1 to 310 do a[i,k,x]:=1;
              y:=i;
              if j>y then y:=j;
              if k>y then y:=k;
              for x:=1 to 310-y do a[i+x,j+x,k+x]:=1;
              end;
      if a[qc[1],qc[2],qc[3]]=0 then res:=2 else res:=1;
      end;
    end;

begin
{assign(input,file1);
assign(output,file2);
reset(input);
rewrite(output);{}
for t:=1 to 1 do
  begin
  clear;
  load;
  run;
  save;
  end;
{close(input);
close(output); {}
end.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE CONSOLE}

const file1='d.in';
      file2='d.out';
      oo=maxlongint div 2;
      empty='';
      eps=1e-6;
      dohrena=1e21;

var qc,he:array[0..2009]of longint;
    ss:array[0..2009]of string;
    qq,cc:array[0..500000]of longint;
    bb:array[0..500000]of boolean;
    xx,yy,zz:array[0..500000]of extended;
    a:array[0..331,0..331,0..331]of byte;
    y,x,ii,jj,kk,t,test,u,v,w,n,m,r,p,q,c,h,e,r0,r1,r2,res:longint;
    s,s0,s1,s2:string;
    sss:ansistring;
    z,x0,x1,x2,y0,y1,y2,z0,z1,z2:extended;
    ch:char;
    b,b0,b1,b2:boolean;

procedure clear;
var i,j,k:longint;
    begin
    end;

procedure load;
var i,j,k:longint;
    begin
    read(n);
    for i:=1 to n do read(qc[i]);
    end;

procedure save;
var i,j,k:longint;
    begin
    if res=1 then writeln('BitLGM') else writeln('BitAryo');
    end;

procedure run;
var i,j,k:longint;
    begin
    res:=0;
    if n=1 then
      begin
      res:=1;
      if qc[1]=0 then res:=2;
      end;
    if n=2 then
      begin
      if abs(qc[1]-qc[2])=1 then res:=2 else res:=1;
      if qc[1]+qc[2]=1 then res:=1;
      if qc[1]+qc[2]=0 then res:=2;
      end;
    if n=3 then
      begin
      a[0,0,0]:=0;
      for i:=0 to 320 do
        for j:=0 to 320 do
          for k:=0 to 320 do
            if a[i,j,k]=0 then
              begin
              for x:=i+1 to 310 do a[x,j,k]:=1;
              for x:=j+1 to 310 do a[i,x,k]:=1;
              for x:=k+1 to 310 do a[i,k,x]:=1;
              y:=i;
              if j>y then y:=j;
              if k>y then y:=k;
              for x:=1 to 310-y do a[i+x,j+x,k+x]:=1;
              end;
      if a[qc[1],qc[2],qc[3]]=0 then res:=2 else res:=1;
      end;
    end;

begin
{assign(input,file1);
assign(output,file2);
reset(input);
rewrite(output);{}
for t:=1 to 1 do
  begin
  clear;
  load;
  run;
  save;
  end;
{close(input);
close(output); {}
end.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE CONSOLE}

const file1='d.in';
      file2='d.out';
      oo=maxlongint div 2;
      empty='';
      eps=1e-6;
      dohrena=1e21;

var qc,he:array[0..2009]of longint;
    ss:array[0..2009]of string;
    qq,cc:array[0..500000]of longint;
    bb:array[0..500000]of boolean;
    xx,yy,zz:array[0..500000]of extended;
    a:array[0..331,0..331,0..331]of byte;
    aa:array[0..331,0..331]of byte;
    y,x,ii,jj,kk,t,test,u,v,w,n,m,r,p,q,c,h,e,r0,r1,r2,res:longint;
    s,s0,s1,s2:string;
    sss:ansistring;
    z,x0,x1,x2,y0,y1,y2,z0,z1,z2:extended;
    ch:char;
    b,b0,b1,b2:boolean;

procedure clear;
var i,j,k:longint;
    begin
    end;

procedure load;
var i,j,k:longint;
    begin
    read(n);
    for i:=1 to n do read(qc[i]);
    end;

procedure save;
var i,j,k:longint;
    begin
    if res=1 then writeln('BitLGM') else writeln('BitAryo');
    end;

procedure run;
var i,j,k:longint;
    begin
    res:=0;
    if n=1 then
      begin
      res:=1;
      if qc[1]=0 then res:=2;
      end;
    if n=2 then
      begin
      aa[0,0]:=0;
      for i:=0 to 320 do
        for j:=0 to 320 do
          if aa[i,j]=0 then
            begin
            for x:=i+1 to 310 do aa[x,j]:=1;
            for x:=j+1 to 310 do aa[i,x]:=1;
            y:=i;
            if j>y then y:=j;
            for x:=1 to 310-y do aa[i+x,j+x]:=1;
            end;
      if aa[qc[1],qc[2]]=0 then res:=2 else res:=1;
      end;
    if n=3 then
      begin
      a[0,0,0]:=0;
      for i:=0 to 320 do
        for j:=0 to 320 do
          for k:=0 to 320 do
            if a[i,j,k]=0 then
              begin
              for x:=i+1 to 310 do a[x,j,k]:=1;
              for x:=j+1 to 310 do a[i,x,k]:=1;
              for x:=k+1 to 310 do a[i,k,x]:=1;
              y:=i;
              if j>y then y:=j;
              if k>y then y:=k;
              for x:=1 to 310-y do a[i+x,j+x,k+x]:=1;
              end;
      if a[qc[1],qc[2],qc[3]]=0 then res:=2 else res:=1;
      end;
    end;

begin
{assign(input,file1);
assign(output,file2);
reset(input);
rewrite(output);{}
for t:=1 to 1 do
  begin
  clear;
  load;
  run;
  save;
  end;
{close(input);
close(output); {}
end.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q+,R+,S+,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$IMAGEBASE $00400000}
{$APPTYPE CONSOLE}

const file1='d.in';
      file2='d.out';
      oo=maxlongint div 2;
      empty='';
      eps=1e-6;
      dohrena=1e21;

var qc,he:array[0..2009]of longint;
    ss:array[0..2009]of string;
    qq,cc:array[0..500000]of longint;
    bb:array[0..500000]of boolean;
    xx,yy,zz:array[0..500000]of extended;
    a:array[0..331,0..331,0..331]of byte;
    y,x,ii,jj,kk,t,test,u,v,w,n,m,r,p,q,c,h,e,r0,r1,r2,res:longint;
    s,s0,s1,s2:string;
    sss:ansistring;
    z,x0,x1,x2,y0,y1,y2,z0,z1,z2:extended;
    ch:char;
    b,b0,b1,b2:boolean;

procedure clear;
var i,j,k:longint;
    begin
    end;

procedure load;
var i,j,k:longint;
    begin
    read(n);
    for i:=1 to n do read(qc[i]);
    end;

procedure save;
var i,j,k:longint;
    begin
    if res=1 then writeln('BitLGM') else writeln('BitAryo');
    end;

procedure run;
var i,j,k:longint;
    begin
    res:=0;
    if n=1 then
      begin
      res:=1;
      if qc[1]=0 then res:=2;
      end;
    if n=2 then
      begin
      if abs(qc[1]-qc[2])=1 then res:=2 else res:=1;
      if qc[1]+qc[2]=1 then res:=1;
      end;
    if n=3 then
      begin
      a[0,0,0]:=0;
      for i:=0 to 320 do
        for j:=0 to 320 do
          for k:=0 to 320 do
            if a[i,j,k]=0 then
              begin
              for x:=i+1 to 310 do a[x,j,k]:=1;
              for x:=j+1 to 310 do a[i,x,k]:=1;
              for x:=k+1 to 310 do a[i,k,x]:=1;
              y:=i;
              if j>y then y:=j;
              if k>y then y:=k;
              for x:=1 to 310-y do a[i+x,j+x,k+x]:=1;
              end;
      if a[qc[1],qc[2],qc[3]]=0 then res:=2 else res:=1;
      end;
    end;

begin
{assign(input,file1);
assign(output,file2);
reset(input);
rewrite(output);{}
for t:=1 to 1 do
  begin
  clear;
  load;
  run;
  save;
  end;
{close(input);
close(output); {}
end.