#include<bits/stdc++.h> using namespace std; int main(){ int s,v,h=7,m=50; cin>>s>>v; m-=(s/v); if(s%v!=0) m--; for(;;) if(m<0) { h--; m+=60; } else { break; } cout<<0<<h<<":"; if(m<10) cout<<0<<m; else cout<<m; return 0; }