_=0 while _<195:a=_=-~_;exec"b=int(str(a)[::-1]);a+=(a!=b)*b;"*_;print a