#include <bits/stdc++.h>
using namespace std;
long long n;
void dfs(vector<char> &a, long long v) {
  if (a.size() == n) {
    for (long long i = 0, i_len = (n); i < i_len; ++i) {
      cout << a[i];
    }
    cout << endl;
    return;
  }
  if (a.empty()) {
    a.push_back('a');
    dfs(a, 1);
  } else {
    for (long long i = 0; i < v + 1; i++) {
      a.push_back('a' + i);
      dfs(a, max(v, i));
      a.pop_back();
    }
  }
}
int main() {
  cin >> n;
  vector<char> a;
  dfs(a, 0);
  return 0;
}
