In basketball, a player is allowed to hold the ball for a maximum of 5 seconds after receiving it. Within this period, they must either pass the ball to another player or take a shot. If this rule is violated, it is considered a rule violation.
A device records the exact time each player receives the ball, logging both the minute and second of each event. Your task is to determine the moment of the first rule violation, if any.
The first line contains an integer — the number of device logs.
The next lines each contain two integers representing the time in minutes and seconds when the player received the ball. The times are given in chronological order.
Print two integers, separated by a space — the minute and second when the first rule violation occurred. If there are no rule violations, output 0.
Example 1