#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int a, b, c, d, e;
scanf("%d%d", &a, &b);
if (a % b == 0)
{
c = a/b+10;
}
else
{
c = a / b + 11;
}
if (c <= 480)
{
d = (480-c) / 60;
e = (480-c) % 60;
}
else
{
d = (24 * 60 + (480 - c)) / 60;
e = (24 * 60 + (480 - c)) % 60;
}
if (d > 10)
{
if (e > 10)
{
printf("%d:%d", d, e);
}
else
{
printf("%d:0%d", d, e);
}
}
else
{
if (e > 10)
{
printf("%0d:%d", d, e);
}
else
{
printf("%0d:0%d", d, e);
}
}
return 0;
}