#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  string base = "", end = "";
  for (int i = 0; i < N; i++) {
    base += 'a';
    end += 'a' + i;
  }
  cout << base << endl;
  while (base != end) {
    int keta = N - 1;
    while (base[keta] > base[keta - 1]) {
      keta--;
    }
    base[keta]++;
    for (int i = keta; i > N - 1; i--) base[i] = 'a';
    cout << base << endl;
  }
}
