int main(){ int a,b,c; while(scanf("%d/%d",&a,&b)>1){ for(c=999;c>1;c--){ while(a%c==0&&b%c==0){a/=c;b/=c;} } printf("%d/%d\n",a,b); } }