N = int(input().strip()) print(max('1', ''.join([''.join([str(i) for i in range(N)]) for j in range(N)])[::-1]))