#include <bits/stdc++.h>
using namespace std;
void func(int n, int num, int w[]);
int main(void) {
  int n;
  cin >> n;
  int w[n];
  for (int i = 0; i < n; i++) w[i] = 0;
  func(n, 1, w);
  return 0;
}
void func(int n, int num, int w[]) {
  for (int i = 0; i < n; i++) {
    cout << (char)(w[i] + 97);
  }
  cout << endl;
  for (int i = num; i < n; i++) {
    if (w[i - 1] >= w[i]) {
      int ww[n];
      for (int j = 0; j < n; j++) ww[j] = w[j];
      while (ww[i - 1] >= ww[i]) {
        ww[i]++;
        func(n, num + 1, ww);
      }
    }
  }
}
