// Arup Guha
// 11/2/2013
// Solution to 2013 South East Regional Division 2 Problem I: Speed Can Cost You!

import java.util.*;

public class speed {

	final static int MIN_PER_HR = 60;
	final static int SEC_PER_MIN = 60;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int miles = stdin.nextInt();
		int mph1 = stdin.nextInt();
		int mph2 = stdin.nextInt();

		// Go through each case.
		while (miles != 0) {

			// Output answer...
			format((double)miles/mph1 - (double)miles/mph2);

			// Get next case.
			miles = stdin.nextInt();
			mph1 = stdin.nextInt();
			mph2 = stdin.nextInt();
		}
	}

	public static void format(double hrs) {

		// For rounding...
		hrs += (0.5/MIN_PER_HR/SEC_PER_MIN);

		// Get hours first.
		int hours = (int)hrs;
		System.out.print(hours+":");

		// Get minutes and print.
		double minleft = (hrs-hours)*MIN_PER_HR;
		int min = (int)minleft;
		System.out.print(pad(min)+":");

		int sec = (int)((minleft-min)*SEC_PER_MIN);
		System.out.println(pad(sec));
	}

	// Represent n with 2 digits exactly, n < 60.
	public static String pad(int n) {
		if (n < 10) return "0"+n;
		else return ""+n;
	}
}