t = list(map(int,input().split(':'))) h, m = t[0],t[1] if m >= 55 and h == 23: h = 0 m = (m - 55) h,m = str(h), str(m) elif m >= 55: h += 1 m = (m - 55) h,m = str(h), str(m) else: m += 5 h,m = str(h), str(m) print(f"{h.zfill(2)}:{m.zfill(2)}")