시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 90 41 40 48.193%

문제

철수는 화학 시험을 망치고, 애꿎은 화학 선생님에게 복수를하기로 한다.

철수는 집에서 만든 자동 로봇팔을 선생님의 책상에 숨겨, 선생님이 수업을 시작하려 들어온 순간 숨겨놓은 로봇팔을 이용해 선생님을 혼내주려고한다. 철수는 선생님이 늘 애용하는 물컵에 시간이 되면 로봇팔이 소금을 잔뜩 집어넣도록 프로그램을 짜려고한다.

철수는 현재시각과 선생님이 언제 컵을 사용할지 시간을 알고있지만, 수 계산에 정말 약해서 로봇팔에 입력해야할 시간 계산을 못한다. 철수가 로봇팔에 알맞은 시간을 입력할수 있도록 도와주자.

입력

첫째 줄에는 현재 시각이 hh:mm:ss로 주어진다. 시간의 경우 0≤h≤23 이며, 분과 초는 각각 0≤m≤59, 0≤s≤59 이다.

두번째 줄에는 소금 투하의 시간이 hh:mm:ss로 주어진다.

출력

로봇팔이 소금을 투하할때까지 필요한 시간을 hh:mm:ss로 출력한다. 이 시간은 1초보다 크거나 같고, 24시간보다 작거나 같다.

예제 입력 1

20:00:00
04:00:00

예제 출력 1

08:00:00

예제 입력 2

12:34:56
14:36:22

예제 출력 2

02:01:26
W3sicHJvYmxlbV9pZCI6IjEzMjIzIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjMThjXHVhZTA4IFx1ZDNlZFx1ZDBjNCIsImRlc2NyaXB0aW9uIjoiPHA+XHVjY2EwXHVjMjE4XHViMjk0IFx1ZDY1NFx1ZDU1OSBcdWMyZGNcdWQ1ZDhcdWM3NDQgXHViOWRkXHVjZTU4XHVhY2UwLCBcdWM1NjBcdWFmY2VcdWM3NDAgXHVkNjU0XHVkNTU5IFx1YzEyMFx1YzBkZFx1YjJkOFx1YzVkMFx1YWM4YyBcdWJjZjVcdWMyMThcdWI5N2NcdWQ1NThcdWFlMzBcdWI4NWMgXHVkNTVjXHViMmU0LjxcL3A+XHJcblxyXG48cD5cd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