N=int(input())
alp="abcdefghij"
S=[""for i in range(N)]

def gen(cnt,rem):
    if rem==0:
        print("".join(S))
    else:
        for i in range(min(N,cnt+2)):
            S[N-rem]=alp[i]
            gen(i,rem-1)            

S[0]="a"
gen(0,N-1)
    
    