Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/keyingi-sana

Next date

Easy 1000 ms 64 MB 25%
Share

A valid date of a non-leap year is given: day $D$ and month $M$. Find the day and month of the next day. February has $28$ days; January 1 comes after December 31.

Moving to the next day on a calendar page

Input

One line with two integers: $D$ and $M$.

Output

One line with two integers: the day and month of the next day.

Note

$1 \le M \le 12$
$1 \le D \le 31$
The date is guaranteed to be valid.

Examples

Input #1
1 3
Output #1
2 3
Input #2
31 1
Output #2
1 2

Sign in to submit a solution

Signing up is free and takes a minute.