Two players play. A date in is given. Each player on their turn names a later date, increasing by or either the day of the month or the month, but not both at once. In this case, the combination of day and month must remain a valid date. The player who names December 31 loses. Both players play optimally. Based on the given date, determine who will win.
The first line contains two space-separated numbers representing the day and the month.
The month is from to , the day is from to the number of days in the month. The date "31 December" will not appear in the input.
Output 1 if the first (starting) player wins, or 2 otherwise.
Example 1