eolymp
bolt
Try our new interface for solving problems
Problems

The game of "Date"

The game of "Date"

Play two. Given by some date in \textbf{2004}. Each player on his calls during a later date, increasing by \textbf{1} or \textbf{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 \textbf{December 31}, loses. Both players played well. Based on the specified date, to withdraw, who will win. \InputFile In the first row are separated by a space number for the day and month. Month from \textbf{1} to \textbf{12}, day \textbf{1} to the number of days in the month, the date "\textbf{31 December}" in the input data are not available. \OutputFile Bring to \textbf{1} if won the first (beginner) player, or \textbf{2} - otherwise.
Time limit 1 second
Memory limit 64 MiB
Input example #1
30 12
Output example #1
2