10021 - Unlucky 13 :(

Unlucky 13 :(

Time Limit: 1 sec


The Problem

Our great problem solver Shan reads in class six. He regularly solves problem in Outsbook Programming School Online Judge. Outsbook is going to organize an Inter School and College Programming Contest (ISCPC) on November 13, 2015. So he wants to participate in the contest. November 13 (unlucky number) is really unlucky for him because on that day he has also a class exam. OHH! Shan now is losing track of even simplest of calculations, so you must help him to decide whether he can participate in the contest or not.


Shan is busy with class exam for a large portion of the day. This large portion is denoted by a starting time and an ending time. Also contest has a starting time and an ending time. He will miss the contest if it overlaps or touches (For example, if Shan’s class exam finishes at 14:00 and the contest starts at 14:00 then the two schedules conflict and Shan will miss the contest) the time schedule of contest.


Given the start and end time of the class exam and the programming contest, have to find whether Shan misses that programming contest or not.


The Input

The input file contains several lines of input. Each line contains four string separated by space. First string denotes the starting time of contest and second string denotes the ending time of contest. Third string denotes the starting time of exam and fourth string denotes the ending time of exam. All the strings are of the format HH:MM (two digits for hour and two digits for minute). For example “forty five past nine” (Morning) is denoted as ‘08:45’, “forty five past ten” (night) is denoted as ‘22:45’. You can assume that all times are valid 24-hour clock time, starting time strictly precedes ending time and all times are within a single day. Input is terminated by end of file (EOF).


The Output

For each line of input produces one line of output. If Shan can attend the contest, print “LUCKY 13 :)“ or if Shan misses the contest as it conflicts with the time schedule of exam, print “UNLUCKY 13 :(”. 


Sample Input

17:47 22:40 06:18 17:04

03:36 19:02 14:33 15:24

10:44 17:05 01:11 01:27


Sample Output

LUCKY 13 :)


LUCKY 13 :)




[College Level]

Inter School & College Programming Contest (ISCPC) 2015 

Problem Setter: Shahin ShamS