#include<bits/stdc++.h> using namespace std; int main(){ double a,b; cin>>a>>b; int x=ceil(a/b); printf("%d:%d",7-x/60,50-x%60); return 0; }