e=10**9 x,y=gets.split a=x.to_i b=y.to_i loop{c=a/e;a%=e d=b/e;b%=e c!=d&&($><<(c*d==28)^(c