#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b); //定义输入的变量
const int m_to_h = 60;
const int a_to_h = 100; //定义换算常量
int temp_time = a / a_to_h * m_to_h + a % a_to_h + b ;
//printf("%d\n",temp_time); //全部换算成分钟并计算总值,打印总值进行验算。
int temp_h = temp_time / m_to_h ;
int temp_m = temp_time % m_to_h ;
printf("%d%02d",temp_h,temp_m); //根据总值计算出小时和分钟数,并输出。
return 0;
}