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