#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
const int M=5050;
signed main ()
{
int u,s;
cin>>s>>u;
int sj;
sj=ceil(s/u)+10;
int xiaoshi=8,fenzhong=0;
fenzhong-=sj;
while(fenzhong<0){
fenzhong+=60;
xiaoshi-=1;
}
if(xiaoshi<10){
cout<<0<<xiaoshi<<':';
}else cout<<xiaoshi<<':';
if(fenzhong<10){
cout<<0<<fenzhong-1;
}else cout<<fenzhong-1;
return 0;
}