N=int(input()) M=N*(10**9+1) s="12" while s!="".join(reversed(s)):M+=N*10;s=str(M)[:-1] print(M)