#include <bits/stdc++.h>
using namespace std;
char arr[] = "abcdefghij";
void genStr(int total, int i, string next) {
  if (total == i) {
    cout << next << endl;
    return;
  }
  for (int j = 0; j < i + 1; j++) {
    genStr(total, i + 1, next + arr[j]);
  }
}
int main() {
  int n;
  cin >> n;
  genStr(n, 1, "a");
}
