while 1: x,y=a,b=map(int,raw_input().split("/")) while x:x,y=y%x,x print`a/y`+"/"+`b/y`