def r(d,x,y):q=x*y-s;q<1>q%d!=[r(d*10,x+w//3*d,y+w%3*d+d)for w in range(12-9*(3*x-1