alf = 'abcdefghijklmnopqrstuvwxyz'
d = {c:i+1 for i,c in enumerate(alf)}
d['z']=25
def dfs(n):
    lst = []
    lst.append(['a'])
    while lst:
        a = lst.pop()
        if len(a) == n:
            print(''.join(a))
            continue
        for i in range(d[a[-1]]+1)[::-1]:
            lst.append(a + [alf[i]])

n= int(input())
dfs(n)
