Problem:


ビデオテープ

標準録画で 120 分のビデオテープがあります。テープを完全に巻き戻した状態でビデオデッキのカウンタを 00:00:00 にし、標準録画モードで録画したところ、あるカウンタ値になりました。このカウンタ値（時、分、秒）を入力し、残りのテープの長さ（録画可能時間）を求め、時：分：秒の形式で出力するプログラムを作成して下さい。

ただし、2 時間（120分）以内の入力とします。なお、テープ残量は標準録画モードと 3  倍録画モードの場合の２通りを計算し、出力例のように時、分、秒とも 2 桁ずつ出力します。また "05" のように 10 の位が 0 の場合は、"0" をつけてください。

入力

 複数のデータセットが与えられます。各データセットは以下のとおりです。

T H S

T, H, S はそれぞれ時、分、秒を表す整数です。

T, H, S がすべて -1 のとき入力の終わりとします。データセットの数は 50 を超えません。

出力

各データセットごとに

1 行目に、テープの残りを標準録画した場合の録画可能時間の時、分、秒を半角コロン区切りで、

2 行目に、テープの残りを３倍録画した場合の録画可能時間の時、分、秒を半角コロン区切りで

出力して下さい。

Sample Input

1 30 0
-1 -1 -1

Output for the Sample Input

00:30:00
01:30:00



Sample input:
1 30 0
-1 -1 -1


Sample output:
00:30:00
01:30:00

Submission status: Wrong Answer

Solution code:
while 1:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rest = 2 * 60 * 60
    rest3 = 2 * 60 * 60 * 3
    rest -= h * 60 * 60 + m * 60 + s
    rest3 -= h * 60 * 60 + m * 60 + s
    rest3 /= 3
    print "%02d:%02d:%02d" % (rest / 3600, rest % 3600 / 60, rest % 3600 % 60)
    print "%02d:%02d:%02d" % (rest3 / 3600, rest3 % 3600 / 60, rest3 % 3600 % 60)

Submission status: Wrong Answer

Solution code:
while 1:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rest = 2 * 60 * 60
    rest3 = 2 * 60 * 60
    rest -= h * 60 * 60 + m * 60 + s
    rest3 -= (h * 60 * 60 + m * 60 + s) / 3
    print "%02d:%02d:%02d" % (rest / 3600, rest % 3600 / 60, rest % 3600 % 60)
    print "%02d:%02d:%02d" % (rest3 / 3600, rest3 % 3600 / 60, rest3 % 3600 % 60)

Submission status: Wrong Answer

Solution code:
while 1:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rest = 2 * 60 * 60
    rest3 = 2 * 60 * 60
    rest -= h * 60 * 60 + m * 60 + s
    rest3 -= (h * 60 * 60 + m * 60 + s + 2) / 3
    print "%02d:%02d:%02d" % (rest / 3600, rest % 3600 / 60, rest % 3600 % 60)
    print "%02d:%02d:%02d" % (rest3 / 3600, rest3 % 3600 / 60, rest3 % 3600 % 60)

Submission status: Wrong Answer

Solution code:
while 1:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rest = 2 * 60 * 60
    rest3 = 2 * 60 * 60
    rest -= h * 60 * 60 + m * 60 + s
    rest3 -= (h * 60 * 60 + m * 60 + s) / 3
    if rest < 0:
        rest = 0
    if rest3 < 0:
        rest3 = 0
    print "%02d:%02d:%02d" % (rest / 3600, rest % 3600 / 60, rest % 3600 % 60)
    print "%02d:%02d:%02d" % (rest3 / 3600, rest3 % 3600 / 60, rest3 % 3600 % 60)

Submission status: Wrong Answer

Solution code:
while 1:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rest = 2 * 60 * 60
    rest3 = 2 * 60 * 60
    rest -= h * 60 * 60 + m * 60 + s
    rest3 -= (h * 60 * 60 + m * 60 + s + 2) / 3
    if rest < 0:
        rest = 0
    if rest3 < 0:
        rest3 = 0
    print rest3
    print "%02d:%02d:%02d" % (rest / 3600, rest % 3600 / 60, rest % 3600 % 60)
    print "%02d:%02d:%02d" % (rest3 / 3600, rest3 % 3600 / 60, rest3 % 3600 % 60)

Submission status: Wrong Answer

Solution code:
while 1:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rest = 2 * 60 * 60
    rest3 = 2 * 60 * 60
    rest -= h * 60 * 60 + m * 60 + s
    rest3 -= (h * 60 * 60 + m * 60 + s + 2) / 3
    if rest < 0:
        rest = 0
    if rest3 < 0:
        rest3 = 0
    print "%02d:%02d:%02d" % (rest / 3600, rest % 3600 / 60, rest % 3600 % 60)
    print "%02d:%02d:%02d" % (rest3 / 3600, rest3 % 3600 / 60, rest3 % 3600 % 60)

Submission status: Wrong Answer

Solution code:
def t_shift(rem):
    h = m = s = 0
    if rem > 3600:
        h = rem / 3600
        rem -= 3600*h
    if rem > 60:
        m = rem / 60
        rem -= 60*m
    s = rem
    print str(h).rjust(2, '0') + ":" + str(m).rjust(2, '0') + ":" + str(s).rjust(2, '0')

while True:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rem1 = 7200 - 3600*h - 60*m - s
    rem2 = 3*rem1
    t_shift(rem1)
    t_shift(rem2)

Submission status: Wrong Answer

Solution code:
while 1:
    t,h,s=map(int,raw_input().split())
    if t==h==s==-1:
        break
    rs=2*60*60-t*60*60-h*60-s
    rs3=2*60*60-t*60*60/3-h*60/3-s/3
    nt=rs/3600;nh=(rs%3600)/60;ns=rs%60
    nt3=rs3/3600;nh3=(rs3%3600)/60;ns3=rs3%60
    print("%02d:%02d:%02d"%(nt,nh,ns))
    print("%02d:%02d:%02d"%(nt3,nh3,ns3))

Submission status: Wrong Answer

Solution code:
while 1:
    t,h,s=map(int,raw_input().split())
    if t==h==s==-1:
        break
    rs=2*60*60-t*60*60-h*60-s
    rs3=2*60*60-t*60*60/3-h*60/3-((s-1)/3+1)
    nt=rs/3600;nh=(rs%3600)/60;ns=rs%60
    nt3=rs3/3600;nh3=(rs3%3600)/60;ns3=rs3%60
    print("%02d:%02d:%02d"%(nt,nh,ns))
    print("%02d:%02d:%02d"%(nt3,nh3,ns3))

Submission status: Wrong Answer

Solution code:
def change(time):
  if time >= 10:
    return str(time)
  else:
    return "0" + str(time)
def print_times(ans):
  sec = ans % 60
  ans -= sec
  minu = ans % 3600
  ans -= minu
  minu //= 60
  hour = ans//3600
  print(":".join(map(change,(hour,minu,sec))))

while True:
  t,h,s = map(int,input().split())
  if (t,h,s) == (-1,-1,-1):
    break
  ans = 7200 - (3600 * t + 60 * h + s)
  ans2 = 7200 -(3600 * t + 60 * h + s)//3
  print_times(ans)
  print_times(ans2)

Submission status: Wrong Answer

Solution code:
def time(sec):
    h = sec // 3600
    m = (sec % 3600) // 60
    s = (sec % 3600) % 60
    return [h,m,s]

while True:
    t,h,s = map(int,input().split())
    if t == h == s == -1:
        break
    sec = t*3600 + h * 60 + s
    sec = 7200 - sec
    ans = time(sec)
    t_ans = time(3 * sec)
    if ans[2] < 10:
        ans[2] = "0" + str(ans[2])
    print("0"+ str(ans[0])+ ":" + str(ans[1]) + ":" +str(ans[2]))
    if t_ans[2] < 10:
        t_ans[2] = "0" + str(t_ans[2])
    print("0"+ str(t_ans[0])+ ":" + str(t_ans[1]) + ":" +str(t_ans[2]))

Submission status: Wrong Answer

Solution code:
from datetime import timedelta
while True:
    T, H, S = map(int, input().split())
    if T == -1: break
    seconds = int(timedelta(hours=T, minutes=H, seconds=S).total_seconds())
    h, v = divmod(7200-seconds, 3600)
    m, v = divmod(v, 60)
    s = divmod(v, 60)[0]
    ans = []
    for v in [h,m,s]:
        v = str(v)
        if len(v)==1:
            ans.append('0'+str(v))
        else:
            ans.append(str(v))
    print(':'.join(ans))
    h, v = divmod(7200-seconds//3, 3600)
    m, v = divmod(v, 60)
    s = divmod(v, 60)[0]
    ans = []
    for v in [h, m, s]:
        v = str(v)
        if len(v)==1:
            ans.append('0'+str(v))
        else:
            ans.append(str(v))
    print(':'.join(ans))

Submission status: Wrong Answer

Solution code:
def zan(total, flag):
    rest = 7200 - total if flag else 7200 - total // 3
    t, rest = divmod(rest, 3600)
    h, s = divmod(rest, 60)
    print("{0:02d}:{1:02d}:{2:02d}".format(t, h, s))

while True:
    T, H, S = map(int, input().split())
    if T == -1:
        break
    total = T * 3600 + H * 60 + S
    for i in [1, 0]:
        zan(total, i)

Submission status: Wrong Answer

Solution code:
while True:
    t, h, s = map(int, input().split())
    if t == -1:
        break
    rest = []
    rest.append(7200 - (3600*t + 60*h + s))
    rest.append(rest[0]*3)
    for r in rest:
        t = 0
        h = 0
        s = 0
        if r >= 3600:
            t = r//3600
            r -= 3600*t
        if r >= 60:
            h = r//60
            r -= 60*h
        print("{0:02d}:{1:02d}:{2:02d}".format(t, h, s))

Submission status: Wrong Answer

Solution code:
while 1:
 t,h,s=map(int,input().split())
 if t<0:break
 d,e=7200,t*3600+h*60+s
 a,b=d-e,d-e/3
 print(f'{a//3600:02}:{a//60%60:02}:{a%60:02}')
 print(f'{b//3600:02}:{b//60%60:02}:{b%60:02}')

Submission status: Wrong Answer

Solution code:
while 1:
 t,h,s=map(int,input().split())
 if t<0:break
 d,e=7200,t*3600+h*60+s
 a,b=d-e,d-e//3
 print(f'{a//3600:02}:{a//60%60:02}:{a%60:02}')
 print(f'{b//3600:02}:{b//60%60:02}:{b%60:02}')

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin


def print_time_lefts(seconds):
    h, remain = divmod(7200 - seconds, 3600)
    m, s = divmod(remain, 60)
    print('{:02d}:{:02d}:{:02d}'.format(h, m, s))

for line in stdin:
    h, m, s = (int(s) for s in line.split())
    if h == -1 and m == -1 and s == -1:
        break
    seconds = h * 3600 + m * 60 + s
    print_time_lefts(seconds)
    print_time_lefts(seconds // 3)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin


def print_time_lefts(seconds):
    h, remain = divmod(7200 - seconds, 3600)
    m, s = divmod(remain, 60)
    print('{:02d}:{:02d}:{:02d}'.format(h, m, s))

for line in stdin:
    h, m, s = (int(s) for s in line.split())
    if h == -1 and m == -1 and s == -1:
        break
    seconds = h * 3600 + m * 60 + s
    print_time_lefts(seconds)
    print_time_lefts((seconds + 2) // 3)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# coding: utf-8

while True:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break

    full = 2 * 3600
    rest = full - (h * 3600 + m * 60 + s)
    h = int(rest / 3600)
    m = int((rest - h * 3600) / 60)
    s = rest - h * 3600 - m * 60 

    th = int(rest / 1200)
    tm = int((rest - th * 1200) / 20)
    ts = rest - th * 1200 - tm * 20 

    print "{:02}:{:02}:{:02}".format(h, m, s)
    print "{:02}:{:02}:{:02}".format(th, tm, ts)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# coding: utf-8

while True:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break

    full = 2 * 3600
    rest = full - (h * 3600 + m * 60 + s)

    h = int(rest / 3600)
    m = int((rest - h * 3600) / 60)
    s = rest - h * 3600 - m * 60 

    th = int(rest / 1200)
    tm = int((rest - th * 1200) / 20)
    ts = rest - th * 1200 - tm * 20 

    print "{:02d}:{:02d}:{:02d}".format(h, m, s)
    print "{:02d}:{:02d}:{:02d}".format(th, tm, ts)

Submission status: Wrong Answer

Solution code:
while True:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break

    full = 2 * 3600
    rest = full - (h * 3600 + m * 60 + s)

    h = int(rest / 3600)
    m = int((rest - h * 3600) / 60)
    s = rest - h * 3600 - m * 60 

    th = int(rest / 1200)
    tm = int((rest - th * 1200) / 20)
    ts = rest - th * 1200 - tm * 20 

    print "{:02d}:{:02d}:{:02d}".format(h, m, s)
    print "{:02d}:{:02d}:{:02d}".format(th, tm, ts)

Submission status: Wrong Answer

Solution code:
while True:
	h,m,s = map(int, raw_input().split())
	if h + m + s == -3: break
	ans = 120 * 60 - s - m * 60 - h * 3600

	s = ans % 60
	ans -= s
	h = ans / 3600
	ans -= h * 3600
	m = ans / 60

	h2 = 0
	s2 = s * 3
	if s2 > 60:
		m2 += s2 / 60
		s2 = s2 % 60
	m2 = m * 3
	if m2 > 60:
		h2 += m2 / 60
		m2 = m2 % 60
	h2 = h2 + h * 3

	print ":".join(map(str,['%02d' % h,'%02d' % m,'%02d' % s]))
	print ":".join(map(str,['%02d' % h2,'%02d' % m2,'%02d' % s2]))

Submission status: Wrong Answer

Solution code:
from datetime import timedelta
def f(h,m,s):
    return timedelta(hours=h,minutes=m,seconds=s)

t1=f(2,0,0)
while 1:
    h,m,s=map(int,raw_input().split())
    if [h,m,s]==[-1,-1,-1]: break
    t=t1-f(h,m,s)
    print t
    print t*3

Submission status: Wrong Answer

Solution code:
N=60
def f(t):
    c,t=t%N,t/N
    print "%02d:%02d:%02d"%(t/N,t%N,c)
    return

t=2*N*N
while 1:
    h,m,s=map(int,raw_input().split())
    if [h,m,s]==[-1,-1,-1]: break
    t-=(h*N+m)*N+s
    f(t)
    f(t*3)

Submission status: Accepted

Solution code:
while True:
    t, h, s = map(int, input().split())
    if t == -1:
        break
    ans = 7200-(t*3600+h*60+s)
    ans2 = ans*3
    print("{:02d}:{:02d}:{:02d}".format(ans//3600, (ans//60)%60, ans%60))
    print("{:02d}:{:02d}:{:02d}".format(ans2//3600, (ans2//60)%60, ans2%60))

Submission status: Accepted

Solution code:
from datetime import datetime as dt


while True:
    s = raw_input()
    if s == "-1 -1 -1":
        exit()
    d = dt.strptime(s,'%H %M %S')
    d0 = dt.strptime("2 0 0",'%H %M %S')
    sec = (d0-d).seconds
    print '{:02}:{:02}:{:02}'.format(sec // 3600, sec % 3600 // 60, sec % 60)
    sec *= 3
    print '{:02}:{:02}:{:02}'.format(sec // 3600, sec % 3600 // 60, sec % 60)

Submission status: Accepted

Solution code:
from datetime import datetime as dt


d0 = dt.strptime("2 0 0",'%H %M %S')

while True:
    s = raw_input()
    if s == "-1 -1 -1":
        exit()
    d = dt.strptime(s,'%H %M %S')
    sec = (d0-d).seconds
    print '{:02}:{:02}:{:02}'.format(sec // 3600, sec % 3600 // 60, sec % 60)
    sec *= 3
    print '{:02}:{:02}:{:02}'.format(sec // 3600, sec % 3600 // 60, sec % 60)

Submission status: Accepted

Solution code:
while 1:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rest = 2 * 60 * 60
    rest -= h * 60 * 60 + m * 60 + s
    rest3 = rest * 3
    print "%02d:%02d:%02d" % (rest / 3600, rest % 3600 / 60, rest % 3600 % 60)
    print "%02d:%02d:%02d" % (rest3 / 3600, rest3 % 3600 / 60, rest3 % 3600 % 60)

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

from datetime import timedelta

def formatHHMMSS(delta):
    return '{:02d}:{:02d}:{:02d}'.format(delta.seconds // 3600, delta.seconds % 3600 // 60, delta.seconds % 60)

while True:
    leave_time = timedelta(hours=2)
    h, m, s = map(int, f.readline().split())
    if h == m == s == -1:
        break
    record_time =  timedelta(seconds=s, minutes=m, hours=h)
    leave_time -= record_time
    print(formatHHMMSS(leave_time))
    print(formatHHMMSS(leave_time * 3))

Submission status: Accepted

Solution code:
while(1):
    [h,m,s]=[int(x) for x in raw_input().split()]
    if h<0:
        break
    else:
        rests=2*3600-s-60*m-3600*h
        rests3=rests*3
        A=[rests/3600,(rests%3600)/60,rests%60]
        a=''
        b=''
        B=[rests3/3600,(rests3%3600)/60,rests3%60]
        for x in range(3):
            if A[x]<10:
                a=a+'0'+str(A[x])
            else:
                a=a+str(A[x])
            if x!=2:
                a=a+':'
        print a
        for x in range(3):
            if B[x]<10:
                b=b+'0'+str(B[x])
            else:
                b=b+str(B[x])
            if x!=2:
                b=b+':'
        print b# your code goes here

Submission status: Accepted

Solution code:
def doc_string():
    """
    I can fly.
    """
while True:
    h,m,s = map(int,raw_input().split())
    if h == -1 and m == -1 and s == -1:
        break
    
    h = h * 3600
    m = m * 60
    time = 120 * 60 - (h + m + s)
    h = str(time / 3600)
    m = str(time % 3600 / 60)
    s = str(time % 3600 % 60)
    if len(h) == 1:
        h = "0" + h
    if len(m) == 1:
        m = "0" + m
    if len(s) == 1:
        s = "0" + s
    print h + ":" + m + ":" + s

    h = str(time * 3 / 3600)
    m = str(time * 3 % 3600 / 60)
    s = str(time * 3 % 3600 % 60)
    if len(h) == 1:
        h = "0" + h
    if len(m) == 1:
        m = "0" + m
    if len(s) == 1:
        s = "0" + s
    print h + ":" + m + ":" + s

Submission status: Accepted

Solution code:
while 1:
    h,m,s=map(int,raw_input().split())
    if h==-1:
        break
    t=h*3600+m*60+s
    ans1=7200-t
    ans2=ans1*3
    print "%02d:%02d:%02d"%(ans1/3600,(ans1%3600)/60,ans1%60)
    print "%02d:%02d:%02d"%(ans2/3600,(ans2%3600)/60,ans2%60)
exit()

Submission status: Accepted

Solution code:
def t_shift(rem):
    h = m = s = 0
    if rem >= 3600:
        h = rem / 3600
        rem -= 3600*h
    if rem >= 60:
        m = rem / 60
        rem -= 60*m
    s = rem
    print str(h).rjust(2, '0') + ":" + str(m).rjust(2, '0') + ":" + str(s).rjust(2, '0')

while True:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break
    rem1 = 7200 - 3600*h - 60*m - s
    rem2 = 3*rem1
    t_shift(rem1)
    t_shift(rem2)

Submission status: Accepted

Solution code:
while 1:
    t,h,s=map(int,raw_input().split())
    if t==h==s==-1:
        break
    rs=2*60*60-t*60*60-h*60-s
    rs3=rs*3
    nt=rs/3600;nh=(rs%3600)/60;ns=rs%60
    nt3=rs3/3600;nh3=(rs3%3600)/60;ns3=rs3%60
    print("%02d:%02d:%02d"%(nt,nh,ns))
    print("%02d:%02d:%02d"%(nt3,nh3,ns3))

Submission status: Accepted

Solution code:
def change(time):
  if time >= 10:
    return str(time)
  else:
    return "0" + str(time)
def print_times(ans):
  sec = ans % 60
  ans -= sec
  minu = ans % 3600
  ans -= minu
  minu //= 60
  hour = ans//3600
  print(":".join(map(change,(hour,minu,sec))))

while True:
  t,h,s = map(int,input().split())
  if (t,h,s) == (-1,-1,-1):
    break
  ans = 7200 - (3600 * t + 60 * h + s)
  ans2 = ans * 3
  print_times(ans)
  print_times(ans2)

Submission status: Accepted

Solution code:
def time(sec):
    h = sec // 3600
    ti = sec % 3600
    m = ti // 60
    s = ti % 60
    return [h,m,s]

while True:
    t,h,s = map(int,input().split())
    if t == h == s == -1:
        break
    sec = t*3600 + h * 60 + s
    sec = 7200 - sec
    ans = time(sec)
    t_ans = time(3 * sec)
    if ans[2] < 10:
        ans[2] = "0" + str(ans[2])
    if ans[1] < 10:
        ans[1] = "0" + str(ans[1])
    print("0"+ str(ans[0])+ ":" + str(ans[1]) + ":" +str(ans[2]))
    if t_ans[2] < 10:
        t_ans[2] = "0" + str(t_ans[2])
    if t_ans[1] < 10:
        t_ans[1] = "0" + str(t_ans[1])

    print("0"+ str(t_ans[0])+ ":" + str(t_ans[1]) + ":" +str(t_ans[2]))

Submission status: Accepted

Solution code:
def f(t):
    print("{:02d}:{:02d}:{:02d}".format(t//3600,(t%3600)//60,(t%3600)%60))
if __name__=="__main__":
    while 1:
        h,m,s=map(int,input().split())
        if h<0:break
        t=7200-h*3600-m*60-s
        f(t)
        f(t*3)

Submission status: Accepted

Solution code:
def s2hms(sec):
    h,m1 = divmod(sec,3600)
    m,s  = divmod(m1,60)
    return("%.2d:%.2d:%.2d" % (h,m,s))

while True:
    h,m,s = map(int,input().strip().split())
    if h==-1 and m==-1 and s==-1:
        break

    rest = 120*60 - ((h*60 + m)*60 + s)
    print(s2hms(rest))
    print(s2hms(3*rest))

Submission status: Accepted

Solution code:
def zan(total, flag):
    rest = 7200 - total if flag else (7200 - total) * 3
    t, rest = divmod(rest, 3600)
    h, s = divmod(rest, 60)
    print("{0:02d}:{1:02d}:{2:02d}".format(t, h, s))

while True:
    T, H, S = map(int, input().split())
    if T == -1:
        break
    total = T * 3600 + H * 60 + S
    for i in [1, 0]:
        zan(total, i)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os
import math

def second_to_str(second):
    T = second // 3600
    second -= 3600 * T

    H = second // 60
    second -= 60 * H

    S = second
    return "{:02d}:{:02d}:{:02d}".format(T, H, S)

for s in sys.stdin:
    T, H, S = map(int, s.split())
    if T == H == S == -1:
        break

    past_second = T * 3600 + H * 60 + S

    rest_second = 120 * 60 * 1 - past_second
    rest_second_3x = rest_second * 3

    print(second_to_str(rest_second))
    print(second_to_str(rest_second_3x))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0074
"""
import sys


def calc_remaining_second(hh, mm, ss):
    elapsed = (hh*3600) + (mm*60) + ss
    return (3600*2) - elapsed


def prettify_second(s, mode='normal'):
    if mode == 'long':
        s *= 3
    hh = s // 3600
    s %= 3600
    mm = s // 60
    s %= 60
    ss = s
    return '{:02d}:{:02d}:{:02d}'.format(hh, mm, ss)



def main(args):
    while True:
        hh, mm, ss = [int(x) for x in input().strip().split(' ')]
        if hh == -1 and mm == -1 and ss == -1:
            break
        remaining_sec = calc_remaining_second(hh, mm, ss)
        print(prettify_second(remaining_sec, 'normal'))
        print(prettify_second(remaining_sec, 'long'))


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
# Aizu Problem 0074: Videotape
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


while True:
    t, m, s = [int(_) for _ in input().split()]
    if t == m == s == -1:
        break
    secs_left = 7200 - 3600 * t - 60 * m - s
    for secs in [secs_left, 3 * secs_left]:
        h = secs // 3600
        secs %= 3600
        m = secs // 60
        s = secs % 60
        print("%02d:%02d:%02d" % (h, m, s))

Submission status: Accepted

Solution code:
import math

while True:
    T,H,S = [int(i) for i in input().split()]
    if T == -1 and H == -1 and S == -1:
        break

    ans = 2 * 3600 - (T * 3600 + H * 60 + S)
    TT = ans // 3600
    HH = (ans - 3600*TT) // 60
    SS = ans % 60

    print(str(TT).zfill(2) + ":" + str(HH).zfill(2) + ":" + str(SS).zfill(2))

    ans = ans * 3
    TT = ans // 3600
    HH = (ans - 3600*TT) // 60
    SS = ans % 60

    print(str(TT).zfill(2) + ":" + str(HH).zfill(2) + ":" + str(SS).zfill(2))

Submission status: Accepted

Solution code:
while True:
    t, h, s = map(int, input().split())
    if t == -1:
        break
    rest = []
    rest.append(7200 - (3600*t + 60*h + s))
    rest.append(rest[0]*3)
    for r in rest:
        t = 0
        h = 0
        if r >= 3600:
            t = r//3600
            r -= 3600*t
        if r >= 60:
            h = r//60
            r -= 60*h
        print("{0:02d}:{1:02d}:{2:02d}".format(t, h, r))

Submission status: Accepted

Solution code:
while 1:
 h,m,s=map(int,input().split())
 if h<0:break
 d=7200-h*3600-m*60-s;t=d*3
 print(f'{d//3600:02}:{d//60%60:02}:{d%60:02}')
 print(f'{t//3600:02}:{t//60%60:02}:{t%60:02}')

Submission status: Accepted

Solution code:
p=lambda x:print(f'{x//3600:02}:{x//60%60:02}:{x%60:02}')
while 1:
 h,m,s=map(int,input().split())
 if h<0:break
 d=7200-h*3600-m*60-s
 p(d);p(d*3)

Submission status: Accepted

Solution code:
p=lambda x:print(f'{x//3600:02}:{x//60%60:02}:{x%60:02}')
for e in iter(input,'-1 -1 -1'):
 h,m,s=map(int,e.split())
 d=7200-h*3600-m*60-s
 p(d);p(d*3)

Submission status: Accepted

Solution code:
def sec_to_time(sec):
  h = sec // 3600
  m = sec // 60 - h * 60
  s = sec % 60
  print(str(h).zfill(2) + ":" + str(m).zfill(2) + ":" + str(s).zfill(2))

def solve(h, m, s):
  sec = 7200 - (3600 * h + 60 * m + s)
  sec_to_time(sec)
  sec_to_time(sec * 3)

while True:
  h, m, s = map(int, input().split())
  if h == -1:
    break
  solve(h, m, s)

Submission status: Accepted

Solution code:
# AOJ 0074 Videotape
# Python3 2018.6.14 bal4u

while True:
	a = list(map(int, input().split()))
	if a[0] < 0: break
	t = 7200 - (3600*a[0] + 60*a[1] + a[2])
	print('{:02d}:{:02d}:{:02d}'.format(t//3600, (t%3600)//60, t%60))
	t *= 3
	print('{:02d}:{:02d}:{:02d}'.format(t//3600, (t%3600)//60, t%60))

Submission status: Accepted

Solution code:
# AOJ 0074 Videotape
# Python3 2018.6.14 bal4u

while True:
	T, H, S = list(map(int, input().split()))
	if T < 0: break
	t = 7200 - (3600*T + 60*H + S)
	print('{:02d}:{:02d}:{:02d}'.format(t//3600, (t%3600)//60, t%60))
	t *= 3
	print('{:02d}:{:02d}:{:02d}'.format(t//3600, (t%3600)//60, t%60))

Submission status: Accepted

Solution code:
def print_remain(sec):
    print "{:02}:{:02}:{:02}".format(sec/60**2,sec%60**2/60,sec%60)
while True:
    h,m,s=map(int,raw_input().split())
    if (h,m,s)==(-1,-1,-1):
        break
    sec=h*60**2+m*60+s
    print_remain(2*60**2-sec)
    print_remain((2*60**2-sec)*3)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin


def print_time_lefts(seconds):
    h, remain = divmod(seconds, 3600)
    m, s = divmod(remain, 60)
    print('{:02d}:{:02d}:{:02d}'.format(h, m, s))

for line in stdin:
    h, m, s = (int(s) for s in line.split())
    if h == -1 and m == -1 and s == -1:
        break
    std_time_lefts = 7200 - h * 3600 - m * 60 - s
    print_time_lefts(std_time_lefts)
    print_time_lefts(std_time_lefts * 3)

Submission status: Accepted

Solution code:
while True:
    h,m,s = map(int, raw_input().split())
    if h == -1:
        break
    ls = 7200 - (3600*h + 60*m + s)
    ls3 = 3*ls
    print "%02d:%02d:%02d" % (ls/3600,ls%3600/60,ls%3600%60)
    print "%02d:%02d:%02d" % (ls3/3600,ls3%3600/60,ls3%3600%60)

Submission status: Accepted

Solution code:
#!/usr/bin/python
# coding: utf-8

while True:
    h, m, s = map(int, raw_input().split())
    if h == m == s == -1:
        break

    full = 2 * 3600
    rest = full - (h * 3600 + m * 60 + s)

    h = int(rest / 3600)
    m = int((rest - h * 3600) / 60)
    s = rest - h * 3600 - m * 60 

    th = int(rest / 1200)
    tm = int((rest - th * 1200) / 20)
    ts = (rest - th * 1200 - tm * 20) * 3

    print "{:02d}:{:02d}:{:02d}".format(h, m, s)
    print "{:02d}:{:02d}:{:02d}".format(th, tm, ts)

Submission status: Accepted

Solution code:
while True:
	h,m,s = map(int, raw_input().split())
	if h + m + s == -3: break
	ans = 120 * 60 - s - m * 60 - h * 3600

	s = ans % 60
	ans -= s
	h = ans / 3600
	ans -= h * 3600
	m = ans / 60

	h2 = 0
	m2 = 0
	s2 = s * 3
	if s2 > 60:
		m2 += s2 / 60
		s2 = s2 % 60
	m2 += m * 3
	if m2 > 60:
		h2 += m2 / 60
		m2 = m2 % 60
	h2 += h * 3

	print ":".join(map(str,['%02d' % h,'%02d' % m,'%02d' % s]))
	print ":".join(map(str,['%02d' % h2,'%02d' % m2,'%02d' % s2]))

Submission status: Accepted

Solution code:
from datetime import timedelta
def f(h,m,s):
    return timedelta(hours=h,minutes=m,seconds=s)

t1=f(2,0,0)
while 1:
    h,m,s=map(int,raw_input().split())
    if [h,m,s]==[-1,-1,-1]: break
    t=t1-f(h,m,s)
    t3=t*3
    print "0"+str(t)
    print "0"+str(t3)

Submission status: Accepted

Solution code:
N=60
def f(t):
    c,t=t%N,t/N
    b,a=t%N,t/N
    print "%02d:%02d:%02d"%(a,b,c)
    return

t1=2*N*N
while 1:
    h,m,s=map(int,raw_input().split())
    if [h,m,s]==[-1,-1,-1]: break
    t2=(h*N+m)*N+s
    t=t1-t2
    f(t)
    f(t*3)

Submission status: Accepted

Solution code:
N=60
def f(t):
    c,t=t%N,t/N
    print "%02d:%02d:%02d"%(t/N,t%N,c)
    return

while 1:
    h,m,s=map(int,raw_input().split())
    if [h,m,s]==[-1,-1,-1]: break
    t=7200-(h*N+m)*N-s
    f(t)
    f(t*3)

Submission status: Accepted

Solution code:
import math

def twoch(k):
    if len(str(round(k))) == 1:
        ans = '0' + str(round(k))

    else:
        ans = str(round(k))

    return(ans)

while True:
    lst = list(input().split())
    if lst[0] == '-1':
        break

    T, H, S = int(lst[0]), int(lst[1]), int(lst[2])

    s = 3600*T + 60*H + S
    Sa = 7200 - s
    Sb = 3*Sa

    Ta = Sa//3600
    Sa = Sa - 3600*Ta
    Ha = Sa//60
    Sa = Sa - 60*Ha

    Tb = Sb//3600
    Sb = Sb - 3600*Tb
    Hb = Sb//60
    Sb = Sb - 60*Hb
    
    print(twoch(Ta)+ ':'+ twoch(Ha)+ ':'+ twoch(Sa))
    print(twoch(Tb)+ ':'+ twoch(Hb)+ ':'+ twoch(Sb))

Submission status: Accepted

Solution code:
while True :
    T, H, S = map(int, input().split())
    if T == -1 and H == -1 and S == -1 :
        break
    
    time = T * 3600 + H * 60 + S
    n = 2*60*60 - time
    b = (2*60*60 - time) * 3
    
    n_T = n // 3600
    n_H = (n % 3600) // 60
    n_S = (n % 3600) % 60
    b_T = b // 3600
    b_H = (b % 3600) // 60
    b_S = (b % 3600) % 60
    print('{0:0=2}:{1:0=2}:{2:0=2}'.format(n_T, n_H, n_S))
    print('{0:0=2}:{1:0=2}:{2:0=2}'.format(b_T, b_H, b_S))

Submission status: Accepted

Solution code:
import datetime

while True:
    T,H,S = map(int,input().split())
    if T == -1 and H == -1 and S == -1:
        break

    s0 = 2 * 60**2
    s  = T * 60**2 + H * 60 *1 + S

    s1 = s0 - s
    s3 = 3 * s1

    T1 = s1//60**2
    H1 = (s1-T1*60**2)//60
    S1 = s1 - T1*60**2 - H1*60*1

    if H1 < 10 and S1 < 10:
        print("0%d:0%d:0%d" %(T1,H1,S1))

    elif H1 <10 and S1 >=10:
        print("0%d:0%d:%d" %(T1,H1,S1))

    elif S1 <10:
        print("0%d:%d:0%d" %(T1,H1,S1))
    else:
        print("0%d:%d:%d" %(T1,H1,S1))


    T3  = s3//60**2
    H3 = (s3-T3*60**2)//60
    S3 = s3 - T3*60**2 - H3*60*1

    if H3 < 10 and S3 < 10:
        print("0%d:0%d:0%d" %(T3,H3,S3))

    elif H3 <10 and S3 >=10:
        print("0%d:0%d:%d" %(T3,H3,S3))

    elif S3 <10:
        print("0%d:%d:0%d" %(T3,H3,S3))
    else:
        print("0%d:%d:%d" %(T3,H3,S3))

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
    T, H, S = map(int, readline().split())
    if T == -1:
        return False
    rest = 7200 - (T*3600 + H*60 + S)
    write("%02d:%02d:%02d\n" % (rest//3600, (rest//60)%60, rest%60))
    rest *= 3
    write("%02d:%02d:%02d\n" % (rest//3600, (rest//60)%60, rest%60))
    return True
while solve():
    ...

Submission status: Accepted

Solution code:
# https://note.nkmk.me/python-format-zero-hex/
while 1:
    t,h,s = map(int, input().split())
    if t==h==s==-1:
        break
    rest_time = 7200-(t*3600+h*60+s)
    print('{:02d}:{:02d}:{:02d}'.format(rest_time//3600, (rest_time%3600)//60, rest_time%60))
    rest_time_3 = rest_time*3
    print('{:02d}:{:02d}:{:02d}'.format(rest_time_3//3600, (rest_time_3%3600)//60, rest_time_3%60))

Submission status: Accepted

Solution code:
while True:
    h,m,s = [int(x) for x in input().split()]
    if h < 0 and m < 0 and s < 0:
        break
    r = 7200 - h * 3600 - m * 60 - s
    
    for m in [ 1, 3]:
        tmp = r * m
        dh = tmp // 3600
        dm = (tmp % 3600) // 60
        ds = tmp % 60
        print("{:02d}:{:02d}:{:02d}".format(dh,dm,ds))

Submission status: Accepted

Solution code:
while 1:
    t, h, s = map(int, input().split())
    if t == -1:
        break

    n = 7200 - (3600 * t + 60 * h + s)
    m = n * 3
    print('{:02d}:{:02d}:{:02d}'.format(n // 3600, (n % 3600) // 60, n % 60))
    print('{:02d}:{:02d}:{:02d}'.format(m // 3600, (m % 3600) // 60, m % 60))

Submission status: Accepted

Solution code:
while True:
  T,H,S=map(int,input().split())
  if T==H==S==-1:
    break
  x=120*60-(T*3600+H*60+S)
  print("{:02d}:{:02d}:{:02d}".format(x//3600,(x%3600)//60,x%60))
  x*=3
  print("{:02d}:{:02d}:{:02d}".format(x//3600,(x%3600)//60,x%60))

Submission status: Accepted

Solution code:
while 1:
    H,M,S=list(map(int,input().split()))
    if H<0:break
    t=7200-(3600*H+60*M+S)
    print('{:02d}:{:02d}:{:02d}'.format(t//3600, (t%3600)//60, t%60))
    t *= 3
    print('{:02d}:{:02d}:{:02d}'.format(t//3600, (t%3600)//60, t%60))

Submission status: Accepted

Solution code:
def addzero(n):
	result = str(n)
	if n < 10: result = '0' + result
	return result

def fixtime(second):
	s = second
	T = s/3600
	s = s%3600
	M = s/60
	S = s%60
	return addzero(T)+':'+addzero(M)+':'+addzero(S)
	
while True:
	T, M, S = map(int, raw_input().split())
	if T == -1: break
	leftsecond = 7200 - T*3600 - M*60 - S
	times3 = leftsecond * 3
	print fixtime(leftsecond)
	print fixtime(times3)

Submission status: Accepted

Solution code:
while 1:
    try:
        h,m,s=map(int,input().split())
        if h+m+s==-3:break
        last=7200-h*3600-m*60-s
        print(f'{last//3600:0>2}:{(last%3600)//60:0>2}:{last%60:0>2}')
        last*=3
        print(f'{last//3600:0>2}:{(last%3600)//60:0>2}:{last%60:0>2}')     
    except:break