import java.util.Scanner; public class Speed_artur { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (true) { int d = in.nextInt(); int s1 = in.nextInt(); int s2 = in.nextInt(); if (d == 0 && s1 == 0 && s2 == 0) break; double time1 = d * 3600.0 / s1; double time2 = d * 3600.0 / s2; double diff = time1 - time2; System.out.printf("%d:%02d:%02d\n", (int) (diff / 3600), (int) (diff % 3600 / 60), (int) (diff % 60 + 0.5)); } } }