#include <stdio.h>
int main(){
int begin,time,end;
int hour,min;
scanf("%d %d",&begin,&time);
hour=begin/100;
min=((begin%100)+time)%60;
if(time>=0){
hour=(hour+((begin%100)+time)/60)%24;
}
else{
min+=60;
hour=(hour+((begin%100)+time)/60+23)%24;
}
printf("%d%02d",hour,min); //%02d,确保2位数,不足0补充在左边
return 0;
}