#include <bits/stdc++.h>
using namespace std;
int n;
char a[15];
inline void work(int depth, int last) {
  int now;
  if (depth == n) {
    for (int j = 1; j <= n; j++) cout << char(a[j] + 'a');
    cout << endl;
    return;
  }
  for (int i = 0; i <= min(depth, last + 1); i++) {
    a[depth] = i;
    last = max(last, i);
    work(depth + 1, last);
  }
}
signed main() {
  cin >> n;
  work(0, -1);
  return 0;
}
