Integer
Integer-38
Integer-39
Integer-40
~/algor $ cat problems/kalendar-qatori-va-ustuni
Calendar row and column
Medium
1000 ms
64 MB
37%
A month's calendar is written as a table: each row has $7$ columns, column $1$ is Monday, …, column $7$ is Sunday. Day $1$ of the month falls on day $d$ of the week and is written in column $d$ of row $1$; the following days continue along that row, and when the row ends they continue from column $1$ of the next row. Find the row and the column of day $k$.
Input
One line with two positive integers: $d$ and $k$.
Output
One line with two positive integers: the row number and the column number.
Note
$1 \le d \le 7$
$1 \le k \le 31$
Examples
Input #1
3 17
Output #1
3 5
Input #2
7 1
Output #2
1 7