Integer
Integer-40
Integer-41
Integer-42
~/algor $ cat problems/hafta-kuni-va-vaqt
Weekday and time
Medium
1000 ms
64 MB
38%
The days of the week are numbered: $1$ — Monday, $2$ — Tuesday, …, $7$ — Sunday. It is now day $d$ of the week, $h$ hours $m$ minutes (in $24$-hour format). Find the day of the week and the time in $t$ minutes. At midnight the clock shows $0$ hours $0$ minutes and the next day begins.
Input
One line with four integers: $d$, $h$, $m$ and $t$.
Output
One line with three integers: the weekday (from $1$ to $7$), hours (from $0$ to $23$) and minutes (from $0$ to $59$).
Note
$1 \le d \le 7$
$0 \le h \le 23$
$0 \le m \le 59$
$0 \le t \le 10^{9}$
Examples
Input #1
7 22 30 200
Output #1
1 1 50
Input #2
3 9 15 0
Output #2
3 9 15