import sys
input = sys.stdin.readline

def main():
    m='abcdefghijklmnopqrstuvwxyz'
    m=list(m)
    n=int(input())
    ans=[[] for _ in range(n)]
    ans[0].append('0')
    for i in range(1,n):
        for j in ans[i-1]:
            for k in range(i+1):
                if k<=int(j[-1])+1:
                    ans[i].append(j+str(k))
    p=[]
    for i in ans[n-1]:
        s=''
        for j in range(len(i)):
            s+=m[int(i[j])]
        p.append(s)
    p.sort()
    for i in p:
        print(i)
        
if __name__ == '__main__':
    main()