#yuki964 s='023456789' n=int(raw_input()) if n==1: print 1 else: print s[n-1::-1]*n