Ivica and Marica are attending astronomy classes and are observing two unusual stars. They noted the time when each of them flashed. They further noticed that each of the stars flashes periodically, at regular intervals, and now they are wondering: on what day, at what hour will the stars flash at the same minute for the first time?
For example, if the first star flashed today (Saturday) at : and the second one at :, with the first star flashing every : (every hours and minutes) and the second every : (each hour), then the first one will flash again at : and :, and the second one at :. Therefore, both stars will have flashed at the same minute today at :.
Note that the time : (midnight) is the first minute of a day.
Input Specification
Four lines containing four timestamps in : format (hours:minutes), with , .
The timestamps are, respectively: the time of the first star's flash, the time of the second star's flash, the time between consecutive flashes of the first star, the time between consecutive flashes of the second star.
The first two timestamps will differ, and both fall on the same day - Saturday. Flash intervals will not be :.
Output Specification
If the stars will never flash at the same minute, output Never
in a single line.
Otherwise, output in the first line the name of the weekday of the first same-minute flash. A reminder on the correct spelling of weekdays: Sunday
, Monday
, Tuesday
, Wednesday
, Thursday
, Friday
and Saturday
(note the capital letter).
In the second line, output the timestamp of the first same-minute flash, in : format (with a leading zero if ).
Scoring
In test cases worth of total points, both flash intervals will be hours-only ( will equal ), for example :.
Sample Input 1
02:20
13:00
05:50
01:00
Sample Output 1
Saturday
14:00
Sample Input 2
02:20
23:28
00:40
23:50
Sample Output 2
Never
Sample Input 3
23:19
10:19
02:42
09:11
Sample Output 3
Thursday
00:31
Comments