while(f(a,b,r)=if(b>(y=a%t=10^r++)&y*10\t&f(a\t,y)|!a^r%=11,r,f(a,b,r)),print(f(input,"")))