h,m = map(int,input().split(':')) if m >= 55: m = (m + 5) % 60 h = (h + 1) % 24 else: m += 5 print("%02d:%02d" % (h, m))