#include<iostream>
#include<math.h>
int main()
{
double s,v;
int t;
std::cin>>s>>v;
t=ceil(s/v+10);
if (t<=480)
{
int r=t/60;
int h=7-t;
int m=60-t%60;
std::cout<<h<<":"<<m;
return 0;
}
else
{
int w=(t-480)/60;
int x=23-w;
int y=60-(t-480-w*60);
std::cout<<x<<":"<<y;
return 0;
}
}