CodeForces 630R-Game

柔光的暖阳◎ 2022-08-20 15:15 112阅读 0赞

R. Game

time limit per test

0.5 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

There is a legend in the IT City college. A student that failed to answer all questions on the game theory exam is given one more chance by his professor. The student has to play a game with the professor.

The game is played on a square field consisting of n × n cells. Initially all cells are empty. On each turn a player chooses and paint an empty cell that has no common sides with previously painted cells. Adjacent corner of painted cells is allowed. On the next turn another player does the same, then the first one and so on. The player with no cells to paint on his turn loses.

The professor have chosen the field size n and allowed the student to choose to be the first or the second player in the game. What should the student choose to win the game? Both players play optimally.

Input

The only line of the input contains one integer n (1 ≤ n ≤ 1018) — the size of the field.

Output

Output number 1, if the player making the first turn wins when both players play optimally, otherwise print number 2.

Examples

Input

  1. 1

Output

  1. 1

Input

  1. 2

Output

  1. 2
  2. #include<stdio.h>
  3. #include<string.h>
  4. #include<algorithm>
  5. #define LL long long
  6. using namespace std;
  7. int main()
  8. {
  9. LL n;
  10. while(scanf("%lld",&n)!=EOF)
  11. {
  12. if(n%2==0)
  13. {
  14. printf("2\n");
  15. }
  16. else
  17. printf("1\n");
  18. }
  19. return 0;
  20. }

发表评论

表情:
评论列表 (有 0 条评论,112人围观)

还没有评论,来说两句吧...

相关阅读