Time limit: 1s
Memory limit: 256MB
Input:
Output:
and are playing a game.
They start from a set of distinct positive integers. The coaches take turns. In one move a coach chooses two distinct integers and from the set such that the set does not contain
|| and then add || to the set. If one of the coaches cannot make any valid move he loses.
You need to find which coach will win. makes the first move.
Input
The first line contains a single integer () – the length of the initial set .
The second line contains distinct positive integers ().
Output
Print 1
if wins or 2
if wins.
Example 1
stdin
2
3 2
stdout
1
Example 2
stdin
2
3 5
stdout
1
Example 3
stdin
3
7 5 6
stdout
2