import java.util.Scanner;
public class Main {
public static void main
(String[] args
) { Scanner sc
= new Scanner
(System.
in); int h1, m1, s1, h2, m2, s2;
int sum1, sum2, sec, time1, time2;
int h3, m3, s3;
h1 = sc.nextInt();
m1 = sc.nextInt();
s1 = sc.nextInt();
h2 = sc.nextInt();
m2 = sc.nextInt();
s2 = sc.nextInt();
sum1 = h1 + m1 * 24 + s1 * 24 * 60;
sum2 = h2 + m2 * 24 + s2 * 24 * 60;
sec = (sum2 - sum1 + 86400) % 86400;
time1 = 3600 * h1 + 60 * m1 + s1;
time2 = (time1 + sec) % 86400;
s3 = time2 % 60;
m3 = ((time2 - s3) / 60) % 60;
h3 = (time2 - m3 * 60 - s3) / 3600;
System.
out.
print(h3
+ " " + m3
+ " " + s3
); }
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwoKcHVibGljIGNsYXNzIE1haW4gewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewoJCVNjYW5uZXIgc2MgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCWludCBoMSwgbTEsIHMxLCBoMiwgbTIsIHMyOwoJCWludCBzdW0xLCBzdW0yLCBzZWMsIHRpbWUxLCB0aW1lMjsKCQlpbnQgaDMsIG0zLCBzMzsKCQloMSA9IHNjLm5leHRJbnQoKTsKCQltMSA9IHNjLm5leHRJbnQoKTsKCQlzMSA9IHNjLm5leHRJbnQoKTsKCQloMiA9IHNjLm5leHRJbnQoKTsKCQltMiA9IHNjLm5leHRJbnQoKTsKCQlzMiA9IHNjLm5leHRJbnQoKTsKCQlzdW0xID0gaDEgKyBtMSAqIDI0ICsgczEgKiAyNCAqIDYwOwoJCXN1bTIgPSBoMiArIG0yICogMjQgKyBzMiAqIDI0ICogNjA7CgkJc2VjID0gKHN1bTIgLSBzdW0xICsgODY0MDApICUgODY0MDA7CgkJdGltZTEgPSAzNjAwICogaDEgKyA2MCAqIG0xICsgczE7CgkJdGltZTIgPSAodGltZTEgKyBzZWMpICUgODY0MDA7CgkJczMgPSB0aW1lMiAlIDYwOwoJCW0zID0gKCh0aW1lMiAtIHMzKSAvIDYwKSAlIDYwOwoJCWgzID0gKHRpbWUyIC0gbTMgKiA2MCAtIHMzKSAvIDM2MDA7CgkJU3lzdGVtLm91dC5wcmludChoMyArICIgIiArIG0zICsgIiAiICsgczMpOwoJfQp9