#!/usr/bin/env python


def plse1(s, i):
    if i == 0:
        return s
    if s[i] > s[i - 1]:
        s = plse1(s, i - 1)
        s[i] = 0
    else:
        s[i] += 1
    return s


n = int(input())
ss = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

s = [0] * n
while True:
    string = ''
    for i in range(n):
        string += ss[s[i]]
    print(string)
    s = plse1(s, n - 1)
    if s == [0] * n:
        break
