N=int(input())
ans = []
def same(c,mc):
    if len(c)==N:
        ans.append(c)
        return
    else:
        for i in range(ord('a'),ord(mc)+2):
            same(c+chr(i),chr(ord(mc)+1))
same('a','a')
for i in ans:
    print(i)