from itertools import combinations_with_replacement,product
N=int(input())
X=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
Z=list(combinations_with_replacement(X,N))

for i in Z[:N]:
    print(*i, sep='') 