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