#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
map<string, vector<string>> graph;
queue<string> str;
int main() {
  ll N;
  cin >> N;
  str.push("a");
  graph["a"] = {};
  set<string> ans;
  while (!str.empty()) {
    if (str.front().size() == N) {
      ans.insert(str.front());
      str.pop();
      continue;
    }
    if (str.front().size() > N) {
      break;
    }
    string t = str.front();
    for (int i = 0; i < (int)(t.at(t.size() - 1) - 'a' + 2); i++) {
      char c = 'a' + i;
      string s = t + c;
      graph.at(t).push_back(s);
      graph[s] = {};
      str.push(s);
    }
    str.pop();
  }
  for (auto st : ans) {
    cout << st << endl;
  }
}
