#include <bits/stdc++.h> using namespace std; int main(){int h,m,s,k;cin>>h>>m>>s>>k;int t=h3600+m60+s+k;cout<<t/3600<<" "<<(t%3600)/60<<" "<<t%60<<"\n";}