#include <bits/stdc++.h>
using namespace std;
constexpr char cs[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
void dfs(string str, int N, size_t pre, size_t lim,
         priority_queue<string, vector<string>, greater<string>>& q) {
  size_t size = str.size();
  if (size != N) {
    for (size_t c = 0; c <= lim; ++c) {
      dfs(str + cs[c], N, c, max(pre, c) + 1, q);
    }
  } else {
    q.push(str);
  }
}
int main() {
  int N;
  cin >> N;
  priority_queue<string, vector<string>, greater<string>> q;
  dfs("a", N, 0, 1, q);
  while (!q.empty()) {
    cout << q.top() << endl;
    q.pop();
  }
  return 0;
}
