- محدودیت زمان: ۱ ثانیه
- محدودیت حافظه: ۲۵۶ مگابایت
Mr. , , and have decided to organize a programming contest so Shengdebao can take part in it! To make the contest they have to arrange a meeting and talk today but they are quite tired and decided to start a video chat instead.
For the video chat to be beneficial they have to talk constantly for exactly 15 minutes and to do this their computer systems should be plugged and have electricity.
The thing is , and live in different locations of the city and due to the over usage of electricity the power department of the city cuts down the power of various locations in some time intervals.
For these three people we know exactly when their power will be cut! You should find out exactly the first time they can start their video chat meeting for 15 minutes. To clarify, you should say the starting time of the 15 minutes interval which all of the three have power and can start the video chat that also ends until 12:00 am!
ورودی
The input contains 3 lines each denoting the intervals in which they don't have any electricity. The first, second and third line indicates the times for , and in the same order. In each line a number is given and afterwards strings are given in the format each string is a given time with being the hour being the minute and being the second. This means from the time between the first and second , rd and th , th and th , ... , and that particular person does not have power.
If there is not any power from second to second it means the interval is inclusive meaning there is no electricity from the beginning of second till the end of second in the interval .
The given , and all have 2 digits for example for representing 6 o'clock in the format it should be written as
خروجی
Output the first time they can have that meeting in the format, meaning they can start talking for 15 minutes in hour minute and second . If they cannot talk for 15 at all you should output "".
مثال
ورودی نمونه ۱
خروجی نمونه ۱
ورودی نمونه ۲
خروجی نمونه ۲
ارسال پاسخ برای این سؤال