import sys
input=sys.stdin.readline
sys.setrecursionlimit(100000000)
MOD = 10**9+7
INF = 10 ** 9

def main():
    n = int(input())
    S = [[] for _ in range(n)]
    S[0] = ['a']
    
    dic = {i:j for i,j in zip(range(10),'abcdefghij')}
    for i in range(1,n):
        kind = 1
        for st in S[i-1]:
            if dic[kind] in st:
                kind += 1
            for j in range(kind+1):
                S[i].append(st+ dic[j])
    print(*S[-1],sep='\n')

if __name__=='__main__':
    main()