N = int(input()) S = "9876543210" print(S[:N])