
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline




def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact


ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
 
def search(seq,k,n):
    global N
    
    if k==N+1:

        res=[ascii_lowercase[s-1] for s in seq[1:]]
        print("".join(res))
        return 
    
    seq[k]=n
    search(seq,k+1,n+1)
    
    for l in range(1,n):
        seq[k] = l
        search(seq, k+1,n)
    

N=int(input())
seq=[-1]*(N+1)
seq[1]=1
search(seq,2,2)
