시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 11 4 4 36.364%

문제

Learner drivers need to complete 50 hours of supervised driving with at least 10 hours, or more, of night driving included in the total amount. Each learner must keep a log book of their supervised driving experience with each entry containing the starting and finishing time for each driving experience.

Poirot-the-inspector has been given the duty of checking the log books and verifying that the driving times add up to the required values and that no single driving experience exceeds 2 hours. If more than, or equal to, half the length of one driving experience occurs during the night (before sunrise or after sunset), then the whole time counts towards night driving. For example, driving from 04:50 to 06:10 on a day when sunrise is at 05:30 counts as night driving. 

However, Poirot has never been good with numbers and he is requesting assistance with this duty. Your task is to write a program that reads a learner's log book and checks that the required driving times have been completed without violating the 2 hour length rule.

입력

The input consists of a number of test cases. The description for each test case starts with an integer N, on a line by itself, that represents the number of entries in one log book. 25 < N < 300. Each of the following N lines contains a record of one driving experience with four times representing sunrise, sunset, and the starting and finishing time in that order. The starting time is strictly smaller than the finishing time. A single space separates the times and each time has a value between 00:00 (midnight) and 23:59 (one minute to midnight), inclusive. A line with a zero by itself terminates the input and is not to be processed.

출력

The output for each log book consists of the string PASS if the required driving times have been completed without violating the 2 hour length rule. Otherwise, print the string NON.

예제 입력

120
05:34 17:41 04:01 04:18
06:49 19:02 06:27 07:29
06:55 18:31 12:18 22:44
07:02 17:55 09:06 10:37
06:49 19:30 04:00 04:22
07:12 18:25 09:14 10:35
05:42 17:01 12:27 12:31
06:03 18:23 17:34 17:54
07:51 18:57 12:25 13:20
06:43 17:52 09:23 10:20
05:10 18:28 07:17 08:18
07:23 19:08 06:32 07:39
06:19 17:44 20:31 20:42
06:11 18:24 05:07 06:42
05:14 17:19 08:25 09:36
07:05 19:22 16:00 17:40
05:25 17:25 10:09 10:30
05:38 19:49 15:22 15:45
05:54 18:54 05:21 06:02
06:45 19:44 04:14 05:28
07:55 17:01 15:24 15:44
06:57 17:30 04:26 04:57
06:31 19:37 04:36 04:59
06:53 17:27 10:23 10:55
05:22 17:21 09:19 09:42
07:26 18:28 09:24 09:36
07:17 17:17 04:10 04:40
07:30 18:46 10:07 10:24
06:14 18:52 12:00 13:10
05:00 17:05 20:26 20:59
07:08 19:33 10:02 10:47
05:37 18:17 04:15 04:25
05:06 17:27 04:13 04:47
07:01 19:39 10:26 10:57
05:26 18:06 10:06 11:19
07:37 18:45 09:21 09:53
06:53 18:55 13:02 14:24
05:09 19:05 15:16 15:33
05:46 19:29 16:19 16:31
07:22 18:53 13:12 13:58
05:04 18:26 06:22 07:23
06:50 17:46 06:08 06:12
06:39 19:18 06:25 06:31
05:45 18:30 16:07 16:47
06:23 17:25 12:22 12:44
06:48 19:21 09:00 09:26
05:52 17:45 05:00 06:48
06:48 18:04 14:01 14:39
06:01 19:56 08:23 09:49
05:23 18:38 06:05 06:51
07:14 19:13 07:14 07:38
05:16 19:43 13:12 14:07
05:18 19:27 13:31 14:20
07:49 17:27 06:24 07:49
06:10 18:20 14:39 14:42
05:53 19:04 18:14 19:19
06:31 17:00 16:19 16:23
06:30 18:06 10:07 11:01
05:50 17:28 13:02 13:33
07:29 18:55 18:01 19:03
05:52 19:40 12:37 13:23
06:08 18:10 06:05 06:06
07:38 18:35 19:12 19:22
07:19 17:59 09:32 09:53
07:38 18:04 12:26 13:35
06:40 17:26 11:07 12:44
05:34 19:36 16:37 16:50
07:28 17:42 16:26 16:39
05:06 17:56 15:07 16:07
05:55 17:44 11:16 12:10
06:52 17:00 20:35 21:25
07:53 18:45 19:17 20:30
05:31 19:02 18:17 19:27
05:35 17:57 06:37 07:25
06:56 19:09 10:01 11:55
06:07 19:47 13:07 14:34
06:45 17:45 10:17 11:45
07:31 17:26 17:06 17:24
06:55 17:28 14:00 14:14
06:41 19:33 07:21 08:33
06:05 19:18 10:26 10:58
05:25 19:36 14:09 15:23
05:41 17:25 07:09 08:53
06:04 17:02 12:19 13:59
05:02 19:28 06:11 07:53
05:17 19:58 08:12 09:45
06:14 18:46 19:28 20:10
07:48 19:58 18:23 18:56
05:22 19:53 19:10 20:54
05:59 18:57 19:32 20:47
06:29 18:59 17:39 18:55
07:05 18:37 17:38 18:09
05:17 18:49 12:10 13:10
07:15 17:27 18:11 18:56
07:53 18:19 05:33 06:25
05:05 19:04 05:23 06:55
05:40 19:13 05:17 05:41
06:39 18:06 14:39 15:08
06:06 18:47 19:16 19:48
06:49 17:19 07:25 08:43
05:28 18:00 10:29 10:37
06:39 17:57 09:38 10:03
07:22 18:00 09:07 10:46
06:25 17:43 05:18 06:00
07:57 18:51 18:36 18:58
05:26 18:17 19:04 19:58
06:28 18:14 08:29 08:44
06:19 19:36 20:27 21:39
05:18 18:46 20:38 21:51
05:15 18:55 04:30 04:45
05:59 18:43 06:31 07:50
05:02 17:16 19:23 19:39
05:46 18:51 07:34 07:57
07:04 17:34 10:06 10:56
07:24 19:04 06:37 06:53
05:25 17:30 20:29 21:21
05:21 19:47 19:29 19:32
07:45 17:46 08:05 09:37
07:02 19:26 05:11 06:26
07:01 18:16 11:30 12:51
176
07:36 18:33 05:00 06:24
06:22 19:51 08:06 09:51
05:17 19:27 15:20 15:46
05:33 19:31 13:25 13:56
07:35 17:51 16:05 17:56
05:38 17:30 19:25 20:25
05:34 18:23 13:14 14:41
06:23 17:58 13:19 14:18
06:05 19:08 12:29 13:55
07:28 18:36 20:16 20:22
05:38 18:35 12:10 12:21
07:01 17:37 13:20 13:24
05:58 18:06 20:08 20:56
07:35 18:51 18:07 18:28
07:46 19:28 08:29 08:57
07:52 18:10 10:03 10:24
06:35 18:29 10:08 10:55
05:52 19:52 09:20 10:59
06:09 18:19 10:12 10:48
05:48 18:40 04:32 05:03
06:35 19:21 10:04 10:37
06:30 18:20 12:07 13:36
06:32 19:58 18:11 18:19
07:38 17:04 14:26 15:39
07:54 18:45 11:28 11:50
07:05 19:18 06:02 07:31
06:33 17:51 14:35 14:51
05:16 19:53 04:09 04:45
05:38 19:46 11:07 11:51
06:03 17:28 10:07 10:24
05:31 19:18 09:00 09:01
05:54 17:04 07:38 07:44
06:44 18:31 17:25 17:31
07:04 17:19 13:22 14:31
07:00 19:16 17:39 17:47
05:51 17:07 07:32 08:48
05:34 18:49 12:35 13:33
06:39 18:31 18:24 19:09
06:24 18:00 15:35 15:45
06:29 18:39 20:27 21:13
05:47 17:34 20:25 20:36
05:36 18:38 12:21 13:08
07:56 18:43 12:12 13:19
05:11 19:25 06:04 07:24
07:07 18:04 18:07 18:43
06:12 18:09 16:24 16:41
07:06 19:45 13:01 13:41
06:01 18:50 18:27 18:30
07:57 18:35 19:31 20:18
06:11 19:17 19:12 19:13
05:51 18:48 09:00 09:41
05:12 19:34 15:04 15:55
05:28 17:38 12:23 12:34
07:16 17:42 19:00 19:26
06:22 19:37 09:29 10:06
07:19 18:34 16:03 17:32
06:19 17:06 04:18 04:20
06:24 19:45 12:29 12:38
07:37 17:18 15:27 16:01
07:23 19:51 10:07 11:17
07:23 17:42 18:25 18:35
07:07 19:52 06:10 07:54
07:38 19:30 12:20 13:57
05:01 19:58 13:02 14:28
05:59 18:30 11:07 12:28
06:50 17:15 11:26 11:35
07:35 19:53 12:20 13:13
07:14 18:54 07:11 08:33
05:48 18:18 14:30 15:19
06:52 17:30 08:16 08:29
07:17 19:34 09:34 09:56
07:57 18:20 13:14 13:56
05:42 19:26 12:10 12:55
07:49 18:14 08:23 08:45
06:11 17:22 18:33 19:35
07:14 19:45 05:35 05:54
05:07 19:25 07:22 08:29
06:51 18:59 07:31 07:56
05:31 19:44 12:27 13:13
05:11 17:26 05:17 06:11
07:29 19:36 19:00 20:16
05:29 19:56 10:00 11:55
06:31 18:50 09:04 09:07
07:30 19:59 05:31 06:36
05:27 19:55 14:03 14:36
05:00 17:41 04:23 04:24
05:27 19:28 06:26 07:44
07:50 17:58 14:34 14:45
07:58 17:20 04:23 05:58
06:47 18:11 13:22 13:26
07:43 17:02 13:08 13:57
05:03 17:46 06:02 07:55
06:32 17:15 06:30 06:36
06:35 19:27 08:27 09:57
07:21 19:52 04:37 04:42
07:18 17:09 17:31 17:51
06:09 18:00 17:32 17:44
06:25 17:50 16:22 17:52
05:00 19:51 09:09 10:14
07:25 17:15 12:15 13:03
05:54 17:21 14:34 14:54
06:03 18:01 13:10 13:51
07:56 19:47 07:03 07:29
07:29 19:12 06:02 06:27
06:33 17:31 09:37 10:30
05:07 17:22 18:13 18:34
07:08 17:50 12:25 12:51
07:41 17:52 09:18 10:45
07:28 18:28 12:19 13:40
06:48 17:18 05:04 06:33
05:56 19:28 09:21 09:28
05:43 19:26 12:18 12:41
07:12 17:18 11:04 11:49
07:10 19:18 18:10 18:32
07:07 19:17 16:28 16:32
07:00 18:44 06:20 06:47
07:03 18:10 05:08 05:15
06:37 19:28 16:02 16:23
06:52 17:12 09:33 10:08
07:22 18:45 06:24 07:42
07:07 18:43 09:16 09:21
05:12 18:44 11:19 11:43
06:16 19:37 13:18 14:41
07:09 18:50 04:17 05:10
06:45 18:53 09:18 09:31
06:16 19:00 11:27 12:40
07:55 19:57 18:06 18:12
05:48 17:03 16:11 16:45
06:11 17:54 08:02 09:57
06:39 18:36 07:15 08:05
07:00 19:56 15:03 16:31
07:52 17:04 10:17 10:56
05:37 18:37 14:12 15:10
05:46 19:24 19:25 19:41
06:47 18:00 15:03 16:32
05:19 18:40 12:20 13:25
05:13 19:30 08:27 09:06
07:44 18:59 05:28 05:48
07:17 19:52 07:38 08:21
05:09 18:10 09:10 10:33
07:22 18:52 09:32 09:38
07:49 18:18 10:00 10:19
06:11 17:52 19:08 20:43
06:35 17:01 12:36 13:25
06:06 18:13 15:39 16:05
06:40 17:30 11:21 11:53
07:49 17:35 16:26 16:58
07:09 17:14 06:03 07:13
06:54 17:51 19:24 19:54
06:35 17:03 04:14 05:17
06:42 19:29 08:28 08:45
06:48 17:53 09:33 10:57
05:27 18:28 08:13 08:38
07:48 19:01 18:00 18:57
07:37 19:13 08:00 09:40
05:43 17:29 19:38 19:41
07:35 19:35 16:34 16:56
07:27 19:21 16:14 17:04
06:36 17:23 15:17 16:18
07:02 17:00 18:34 19:57
07:09 17:44 12:02 12:39
06:46 17:37 10:13 10:59
06:06 19:27 11:27 12:26
06:39 17:43 12:13 12:19
05:06 17:14 17:01 17:38
06:40 19:52 14:26 14:34
05:18 17:33 04:11 05:19
05:57 18:12 13:27 14:27
05:35 18:00 19:36 19:45
05:41 18:27 17:30 18:59
07:19 17:36 05:15 05:16
07:26 17:00 10:14 10:27
05:14 19:50 08:28 08:52
06:06 17:34 13:01 14:32
06:59 18:14 13:34 13:38
06:41 18:41 05:33 06:59
0

예제 출력

NON
PASS

힌트