from sys import stdin
import copy

letters = [chr(i) for i in range(97, 97+26)]

def main():

    input = stdin.readline

    N = int(input())   

    ans_list = []

    dp(ans_list,0,N)
    

def dp(ans_list,keta,N):

    for i in range(keta+1):
        tmp_list = copy.copy(ans_list)
        tmp_list.append(i)
        if keta + 1 < N:
            dp(tmp_list,keta + 1,N)
            
        else:
            ans = ""
            for i in tmp_list:
                ans += letters[i]
            print(ans)

if __name__ == "__main__":
    main()