#include <bits/stdc++.h>
using namespace std;
int main() {
int s,v,t,h,min,x;
cin>>s>>v;
t=s/v+10;
if(t%60!=0){
h=7-(t/60);
min=t%60;
}
else {
h=8-(t/60);
min=0;
}
if(h<0&&h+24>=10){
cout<<h+24<<":";
}
else if(h<0&&h+24<=10){
cout<<"0"<<h+24<<":";
}
else if(h>=0) {
if (h<<10) {
cout<<"0"<<h<<":";
}
else {
cout<<h<<":";
}
}
x=60-min;
if (x>=10) {
cout<<x-1<<endl;
}
else if(x<<10){
cout<<"0"<<x-1<<endl;
}
return 0;
}