var g,a,b:word;c:char;begin repeat read(a,c,b);g:=a;while a mod g+b mod g>0do g:=g-1;writeln(a div g,c,b div g)until 0>1end.