a,b,c;main(d,e,f){while(~scanf("%d:%d:%d",&d,&e,&f))printf("%02d:%02d:%02d\t00:%02d:%02d\n",d,e,f,(e-b-(c>f)+60)%60,(f-c+60)%60),a=d,b=e,c=f;}