跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F2521. Yet Another Number Game

    ID: 2527 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>动态规划博弈数学提高难度共享题库Codeforces英文题面题目来源题面语言

Yet Another Number Game

题目描述

D. Yet Another Number Game
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Since most contestants do not read this part, I have to repeat that Bitlandians are quite weird. They have their own jobs, their own working method, their own lives, their own sausages and their own games!

Since you are so curious about Bitland, I'll give you the chance of peeking at one of these games.

BitLGM and BitAryo are playing yet another of their crazy-looking genius-needed Bitlandish games. They've got a sequence of n non-negative integers a1,a2,...,an. The players make moves in turns. BitLGM moves first. Each player can and must do one of the two following actions in his turn:

  • Take one of the integers (we'll denote it as ai). Choose integer x (1≤xai). And then decrease ai by x, that is, apply assignment: ai=ai-x.
  • Choose integer x . And then decrease all ai by x, that is, apply assignment: ai=ai-x, for all i.

The player who cannot make a move loses.

You're given the initial sequence a1,a2,...,an. Determine who wins, if both players plays optimally well and if BitLGM and BitAryo start playing the described game in this sequence.

Input

The first line contains an integer n (1≤n≤3).

The next line contains n integers a1,a2,...,an (0≤ai<300).

Output

Write the name of the winner (provided that both players play optimally well). Either "BitLGM" or "BitAryo" (without the quotes).

Examples
Input
2
1 1
Output
BitLGM
Input
2
1 2
Output
BitAryo
Input
3
1 2 1
Output
BitLGM

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 2163 题。保留原作者与原赛事署名。