d,b,l;main(f,q){for(;gets(q);puts(q))strptime(q,"%T",&b),d+=b+=l*60-d,strftime(q+8,b," 00:%M:%S",gmtime(&b));}