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