#include <bits/stdc++.h>
using namespace std;
const static string ASCII("abcdefghijklmnopqrstuvwxyz");
size_t N;
string canonical(const string& s) {
  map<char, string> m;
  auto it = ASCII.cbegin();
  string res;
  for (char c : s) {
    if (m.find(c) == m.end()) {
      m[c] = *it;
      ++it;
    }
    res += m[c];
  }
  return res;
}
int main() {
  cin >> N;
  set<string> ans;
  stack<string> stk;
  stk.push("");
  while (stk.size()) {
    string s = stk.top();
    stk.pop();
    if (s.size() == N)
      ans.insert(canonical(s));
    else
      for (char c = 'a'; c <= ASCII[s.size()]; c++) stk.push(s + c);
  }
  for (auto& s : ans) printf("%s\n", s.c_str());
}
