#include <bits/stdc++.h>
using namespace std;
void dict(char *word, int current, int cm, int n) {
  int i;
  for (i = 0; i <= cm; i++) {
    word[current] = 'a' + i;
    if (current == n - 1) {
      int j;
      for (j = 0; j < n; j++) cout << word[j];
      cout << endl;
    } else {
      dict(word, current + 1, min(i, cm) + 1, n);
    }
  }
}
int main() {
  int N;
  cin >> N;
  char w[N];
  dict(w, 0, 0, N);
  return 0;
}
