al=[chr(ord('a') + i) for i in range(26)]
def dfs2(N, f):
    if len(f) == N:
        return f
    else:
        result = ""
        f_index = [al.index(i) for i in f]
        for i in range(max(f_index) +1 + 1):#追加できるのは(f+1) + 1
            result +=dfs(N,  f + al[i])
        return result

N = int(input())
ans = dfs2(N, 'a')
for i in range(int(len(ans) / N)):
    print(ans[N*i : N * (i+1)])