ans=[1071,10328,841341] n=int(input()) print(ans[n-1])