#include<bits/stdc++.h>
using namespace std;
int s,v,m,h;
int main(){
cin>> s >> v;
if(s % v == 0){
m = s / v + 10;
}else{
m = s / v + 11;
}
h = m / 60 + 1;
m = m % 60;
if(h >= 8){
h = (h-8)%24;
printf("%02d:%02d",h,60-m);
return 0;
}
printf("%02d:%02d",8-h,60-m);
return 0;
}