/*
TASK:crossing
LANG:C++
*/
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
    double w,s,a,b,t1,t2,t,m,ch,sec;
    cin>>w>>s>>a>>b;
    t1=w/a;
    t2=s/b;
    t=t1+t2;
    ch=floor(t);
    t-=ch;
    t*=60;
    m=floor(t);
    t-=m;
    t*=60;
    sec=ceil(t);
    cout<<ch<<':'<<m<<':'<<sec<<'\n';
    return 0;
}
