#include<iostream>
using namespace std;
int main(){
int s,v;
cin>>s>>v;
int t,t1;
t=s/v;
if(t*v<s)
t=t+1;
t1=t+10;
if(t1>=24*60)
t1=t1-24*60;
int h=t1/60;
int m=t1%60;
int b=60-m;
if(b>=10&&b<60)
cout<<"0"<<(7-h)<<":"<<b;
else
cout<<"0"<<(7-h)<<":"<<"0"<<b;
if(m==0)
cout<<"0"<<(8-h)<<":"<<"00";
system("pause");
return 0;
}