# -*- coding: utf-8 -*-
import numpy as np

n = int(input())


first = 0
last = 0

for i in range(n):
    first += 1 * 10 ** (n - i - 1)
for i in range(n):
    last += (i + 1) * 10 ** (n - i - 1)

array = np.arrange(first, last + 1)

edited_array = np.array([])
ans_array = np.array([])

for num in array:
    for i in range(n):
        tmp = num // 10 ** ( n - i - 1)
        if tmp > n:
            break
        else:
            if i == n - 1:
                edited_array = np.append(edited_array, num)

alphabet_array = [a, b, c, d, e, f, g, h, i, j]

for num in edited_array:
    tmp_str = str(num)
    for i in range(n):
        tmp_str.replace(str(i + 1), alphabet_array[i])
    ans_array = np.append(ans_array, tmp_str)

for char in ans_array:
    print(char)