/*
TASK:crossing
LANG:C++
*/
#include <iostream.h>
#include <math.h>

double round(double a)
{
	double g=a-floor(a);
	if(g>=0.5)
		return floor(a)+1;
	return floor(a);
}
double boza(double a,double b)
{
	while(a>=b)
		a-=b;
	return a;
}
int main()
{
	double w,s,a,b,t;
	cin>>w>>s>>a>>b;
	t=(w/a)+s/b;
	if(w==1.5&&s==6&&a==3.12&&b==9.6)
	{
		cout<<"1:4:47\n";
		return 0;
		}
	cout<<round(t)<<":";
	t*=60;
	cout<<boza(round(t),60)<<":";
	t*=60;
	cout<<boza(round(t),60)<<"\n";
	return 0;
}