#include <bits/stdc++.h>
using namespace std;
void output(vector<int>& v) {
  for (auto e : v) {
    char c = 'a' + e;
    cout << c;
  }
  cout << endl;
}
void dfs(vector<int>& v, int x, int N) {
  if (v.size() == N) {
    output(v);
  } else {
    for (int i = 0; i <= x + 1; i++) {
      v.push_back(i);
      dfs(v, x + 1, N);
      v.pop_back();
    }
  }
  return;
}
int main() {
  int n;
  cin >> n;
  vector<int> v(1, 0);
  dfs(v, 0, n);
  return 0;
}
