20250513
a,b,c=map(int,input().split())
q=int(input())
f=(c+(q%60))%60
e=(b+(q//60)+(c+(q%60))//60)%60
d=(a+(q//3600)+(b+(q//60)+(c+(q%60))//60)//60)%24
print(d,e,f,sep=' ')
3회 조회


a,b,c=map(int,input().split())
q=int(input())
f=(c+(q%60))%60
e=(b+(q//60)+(c+(q%60))//60)%60
d=(a+(q//3600)+(b+(q//60)+(c+(q%60))//60)//60)%24
print(d,e,f,sep=' ')