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

~/algor $ cat problems/oldingi-sana

Previous 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 previous day. February has $28$ days; December 31 comes before January 1.

Going back to the previous 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 previous day.

Note

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

Examples

Input #1
2 3
Output #1
1 3
Input #2
1 3
Output #2
28 2

Sign in to submit a solution

Signing up is free and takes a minute.