The game of "Date"
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Play two. Given by some date in 2004. Each player on his calls during a later date, increasing by 1 or 2, or day of the month, or month, but not both at once. In this case, a combination of day and month should be the date. The player who called the December 31, loses. Both players played well. Based on the specified date, to withdraw, who will win.
Input
In the first row are separated by a space number for the day and month.
Month from 1 to 12, day 1 to the number of days in the month, the date "31 December" in the input data are not available.
Output
Bring to 1 if won the first (beginner) player, or 2 - otherwise.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 14%