while 1: a,b=n,d=map(int,raw_input().split("/")) while b:a,b=b,a%b print`n/a`+('/'+`d/a`)*(d>a)