#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
int main()
{
int s,v,h,m,time;
scanf("%d%d",&s,&v);
if(s%v==0){
time=s/v+10;
}
else{
time=s/v+11;
}
if(time%60==0){
h=time/60;
m=0;
if(h>8||h==8){
h=24+8-h;
}
else{
h=8-h;
}
if(h<10){
printf("0%d:00",h);
}
else{
printf("%d:00",h);
}
}
else{
h=time/60+1;
m=60-time%60;
if(h>8||h==8){
h=24+8-h;
}
else{
h=8-h;
}
if(h<10){
if(m>10){
printf("0%d:%d",h,m);
}
else{
printf("0%d:0%d",h,m);
}
}
else{
if(m>10){
printf("%d:%d",h,m);
}
else{
printf("%d:0%d",h,m);
}
}
}
return 0;
}