Codeforces Round 173 (Div. 2)
D
Yet Another Number Game
Codeforces
2100
原题
← CE →
翻译中…

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 $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$. 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 $*a*_{*i*}$). Choose integer $*x*$ $(1 ≤ *x* ≤ *a*_{*i*})$. And then decrease $*a*_{*i*}$ by $*x*$, that is, apply assignment: $*a*_{*i*} = *a*_{*i*} - *x*$.
  • Choose integer $*x*$ image. And then decrease all $*a*_{*i*}$ by $*x*$, that is, apply assignment: $*a*_{*i*} = *a*_{*i*} - *x*$, for all $*i*$.
翻译中…

The player who cannot make a move loses.

翻译中…

You're given the initial sequence $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$. 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 $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ $(0 ≤ *a*_{*i*} < 300)$.

翻译中…

Output

翻译中…

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

翻译中…

样例

Input #1
2
1 1
Output #1
BitLGM
InputCopy OutputCopy
Input #2
2
1 2
Output #2
BitAryo
InputCopy OutputCopy
Input #3
3
1 2 1
Output #3
BitLGM
InputCopy OutputCopy
题目信息
题号
282D
时间限制
2 s
内存限制
256 MB
标签
动态规划
博弈论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。