n = int(input())
a = ["a","b","c","d","e","f","g","h","i","j"]
def dfs(s):
  m = len(s)
  if m == n:
    ans = ""
    for i in range(n):
      ans += a[int(s[i])]
    print(ans)
  else:
    dfs(s+str(int(s[m-1])))
    dfs(s+str(int(s[m-1])+1))

dfs("0")