#include<iostream>
#include<cmath>
#include<cstring>
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main()
{
int s,u;
cin>>s>>u;
int time=(8*60+24*60)-10;
int use=ceil(s/u*1.0);
time-=use;
if(time>24*60)
{
time-=24*60;
}
printf("%02d:%02d",time/60,time%60-1);
return 0;
}