import string

def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

n = iinp()
a = string.ascii_lowercase

k = n

while k != 0:
  for i in range(2**(k-1)):
    d = []
    p = len(bin(i))
    q = bin(i)
    for j in range(p-2):
      q = bin(i>>j)
      if int(q[len(q)-1]) == 1:
        d.append(k-j-2)

    for i in range(n-k+1):
      print(a[i],end="")
    for j in range(k-1):
      if j in d:
        print(a[n-k+1],end="")
      else:
        print(a[n-k],end="")
    print("")
    k -= 1