import sys
def input(): return sys.stdin.readline().rstrip()
from itertools import combinations
def main():
    n=int(input())
    for kugiri in range(n):
        lis=list(combinations(range(1,n),kugiri))
        lis.sort(reverse=True) 
        for l in lis:
            s=""
            ss='a'
            for moji in range(n):
                if moji in l:
                    ss=chr(ord(ss)+1)
                s+=ss
            print(s)
    

if __name__=='__main__':
    main()