#include <bits/stdc++.h>
using namespace std;
int n;
string s;
map<char, int> bucket;
char nm[10] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
void dfs(int depth, char tis) {
  s.push_back(tis);
  if (s.length() == n) {
    bucket.clear();
    for (auto x : s) bucket[x] = 1;
    if (tis - 'a' >= bucket.size()) {
      s.pop_back();
      return;
    }
    cout << s << endl;
    s.pop_back();
    return;
  }
  for (int i = 0; i < depth + 2; i++) {
    dfs(depth + 1, nm[i]);
  }
  s.pop_back();
  return;
}
int main() {
  cin >> n;
  dfs(0, 'a');
  cin >> n;
  return 0;
}
