#include <bits/stdc++.h>
using namespace std;
std::priority_queue<string, vector<string>, greater<string> > q;
long long n;
inline void dfs(long long depth) {
  if (depth == n + 1) return;
  long long pos = 0;
  string ge[200005];
  while (!q.empty()) {
    string now = q.top();
    q.pop();
    long long len = now.size() - 1;
    for (char i = 'a'; i <= 'z'; i++) {
      if (i - now[len] < 2) ge[++pos] = now + i;
    }
  }
  for (long long i = 1; i <= pos; i++) q.push(ge[i]);
  dfs(depth + 1);
}
signed main() {
  cin >> n;
  q.push("a");
  dfs(2);
  while (!q.empty()) {
    cout << q.top() << endl;
    q.pop();
  }
  return 0;
}
