n = int(input())
s = 'abcdefghij'

def ans(a, c):
    if len(a)==n-1:
        for i in range(c):
            print(a+s[i])
    else:
        for i in range(c):
            a+=s[i]
            ans(a, i+2)
            a=a[0:-1]

ans('', 1)