#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> v;
void dfs(string s) {
  if (s.size() == n) {
    v.push_back(s);
    return;
  }
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    char c = 97 + i;
    dfs(s + c);
  }
}
int main() {
  cin >> n;
  dfs("a");
  for (__typeof(v.size()) i = (0) - ((0) > (v.size()));
       i != (v.size()) - ((0) > (v.size())); i += 1 - 2 * ((0) > (v.size()))) {
    bool y = true;
    for (__typeof(v[i].size()) j = (1) - ((1) > (v[i].size()));
         j != (v[i].size()) - ((1) > (v[i].size()));
         j += 1 - 2 * ((1) > (v[i].size()))) {
      if (v[i][j] >= v[i][j - 1] + 2) {
        y = false;
        break;
      }
    }
    if (y) cout << v[i] << '\n';
  }
  return 0;
}
