#include int main(void){ int n, h, m, t; int i; scanf("%d%d%d%d",&n,&h,&m,&t); for(i=0;i=60){ h++; m -= 60; } if(h>=24) h -= 24; } printf("%d\n%d\n",h,m); return 0; }