import string

N = int(input())
S = string.ascii_letters[:N] 
S_idx = {s:i for i, s in enumerate(S)}

def main(s, n):
    if n >= N:
        return print(s)
    idx =  S_idx[s[-1]]
    for i in S[:idx+2]:
        main(s+i, n+1)
        
main('a', 1)