#include <bits/stdc++.h>
using namespace std;
double s,v;
int main()
{
cin>>s>>v;
int t2=10+ceil(s/v);
if(t2<=60)
{
cout<<"07"<<':'<<60-t2;
}
else
{
int h=floor(t2/60);
int min=t2-h*60;
if(h<=7)
{
cout<<'0'<<7-h<<':'<<60-min;
}
else
{
if(31-h>=10)
cout<<31-h<<':'<<60-min;
else
{
cout<<'0'<<31-h<<':'<<60-min;
}
}
}
}
/*1 6
2 5
3 4
4 3
5 2
6 1
7 0
8 23
9 22
10 21
*/
/*1 6
2 5
3 4
4 3
5 2
6 1
7 0
8 23
9 22
10 21
*/