sub gcd{my($a,$b)=@_;$b?gcd($b,$a%$b):$a} $_+=<>; s/\.//; $d=10**length$'; $g=gcd($_,$d); $_/=$g;$d/=$g; print"$_/$d";