#include<bits/stdc++.h>
using namespace std;
int main()
{
int s,v,t;
cin>>s>>v;
if(s%v==0)
{
t=s/v;
}
else
{
t=s/v+1;
}
int cft=480-t-10;
int h=cft/60,m=cft%60;
if(h<10&&m<10)
{
cout<<0<<h<<':'<<0<<m;
}
else if(h<10)
{
cout<<0<<h<<':'<<m;
}
else if(m<10)
{
cout<<h<<':'<<0<<m;
}
else
{
cout<<h<<':'<<m;
}
return 0;
}