for(;[g,h]=[a,b]=readline().split('/');print(b>g?a/g+'/'+b/g:a/g))for(;h;)h=g%(g=h)