#include #define rep(i,l,n) for(int i=l;i vi; typedef vector vvi; typedef pair pii; int main(){ int n,h,m,t; cin>>n>>h>>m>>t; m+=t*(n-1); h+=m/60; h%=24; m%=60; o(h); o(m); }