#include<bits/stdc++.h>
using namespace std;
int main()
{
int h=7,f=50,s,v;
cin>>s>>v;
while(s>v)
{
s-=v;
f--;
if(f==-1)
{
f=59;
h--;
}
if(h==-1)
{
h=23;
}
}
if(s>0) f--;
if(f == -1)
{
f=59;
h--;
}
if(h==-1)
{
h=23;
}
if(h<10 and f<10)
{
cout<<0<<h<<":"<<0<<s;
return 0;
}
else if(h<10 and f>=10)
{
cout<<0<<h<<":"<<f;
return 0;
}
else if(h>=10 and f<10)
{
cout<<h<<":0"<<f;
return 0;
}
cout<<h<<":"<<f;
return 0;
}