K – The Sacred Number


  • محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

After burning down their own house, Pat & Mat decided to play a game in order to forget their misery. The rules of the game are simple. There are NN stones on the table. Pat & Mat play alternatively. Pat plays first. At each turn, they can either remove 11 or 22 or 33 or 44 or 55 or 66 stones from the table. The player who can't perform any legal move in his turn, will lose the game. Given the number NN, determine which of the brothers will win the game if they play optimally.

ورودی🔗

The input consists of a single integer NN denoting the number of stones. 1N1061 \leq N \leq 10^6

خروجی🔗

Print the name of the winner in a single line.

مثال‌ها🔗

ورودی نمونه ۱🔗

6
Plain text

خروجی نمونه ۱🔗

Pat
Plain text

ورودی نمونه ۲🔗

2233
Plain text

خروجی نمونه ۲🔗

Mat
Plain text
ارسال پاسخ برای این سؤال
در حال حاضر شما دسترسی ندارید.