var n,m,i,d:word;c:char;begin repeat read(n,c,m);for i:=1to 999do if n mod i+m mod i=0then d:=i;writeln(n div d,c,m div d)until 1=0end.