#include <bits/stdc++.h>
using namespace std;
int N;
void dfs(int depth, string cur) {
  if (depth == N)
    cout << cur << endl;
  else {
    int len = cur.size();
    for (int i = 0; i <= cur[len - 1] - 'a' + 1; i++) {
      string next = cur;
      next += 'a' + i;
      dfs(depth + 1, next);
    }
  }
  return;
}
int main() {
  cin >> N;
  dfs(1, "a");
  return 0;
}
