read;$_ a read;$_ b $[x[x=1]=${a// /,x*=},x*=${b// /,x[i=!i]*=},y=x[1],f=2] $[x%f|y%f?++f:(x/=f,y/=f)]{A..R} echo $[x<0?x=-x,-y:y] $x