n = int(input())
alp = [chr(i) for i in range(97, 97+26)]

def update(a, m):
    for val_a, val_m in zip(a,m):
        a_new = []
        m_new = []
        for i in range(val_m + 2):
            a_new += [val_a + alp[i]]
            m_new += [max(val_m, i)]
    return a_new, m_new

a = ['a']
m = [0]

for i in range(n-1):
  a, m = update(a,m)

for v in a:
  print(v)