#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using llu = long long unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
stack<char> s;
stack<char> ts;
void dfs(int dep, char m) {
  if (dep == 1) {
    while (s.size()) {
      ts.push(s.top());
      s.pop();
    }
    while (ts.size()) {
      s.push(ts.top());
      printf("%c", s.top());
      ts.pop();
    }
    printf("\n");
  } else {
    for (ll ci = 'a'; ci < m + 2; ci++) {
      s.push(ci);
      dfs(dep - 1, ci);
      s.pop();
    }
  }
}
int main() {
  int N;
  scanf("%d", &N);
  s.push('a');
  dfs(N, 'a');
  return 0;
}
