main(a,b,c){while(~scanf("%d/%d",&a,&b)){for(c=99;c>1;c--)!(a%c)&!(b%c)?a/=c,b/=c:0;printf("%d/%d\n",a,b);}}