import java.sql.SQLOutput;
import java.util.Scanner;
//60进制-》10进制-》60进制
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
String s1 = s.split(" ")[0];
String s2 = s.split(" ")[1];
int i = Integer.parseInt(s2);
if (s1.length() == 3) {
String substring = s1.substring(0, 1);
int i1 = Integer.parseInt(substring);
//转10进制并运算
int i2 = i1 * 60 + Integer.parseInt(s1.substring(1, 3)) + i;
//转60进制并输出
toSixPrint(i2);
} else {
String substring = s1.substring(0, 2);
int i1 = Integer.parseInt(substring);
//转10进制并运算
int i2 = i1 * 60 + Integer.parseInt(s1.substring(2, 4)) + i;
//转60进制并输出
toSixPrint(i2);
}
}
private static void toSixPrint(int i2) {
int i3 = i2 / 60;
int i4 = i2 - i3 * 60;
System.out.print(i3);
System.out.print(i4);
if (i4 == 0) {
System.out.print("0");
}
}
}
,,ԾㅂԾ,,