#include <bits/stdc++.h>
using namespace std;
void printline(long long n, string s = "", char maxchar = 'a') {
  if (n == s.length()) {
    printf("%s\n", s.c_str());
    return;
  }
  for (long long i = 0; i < (long long)(maxchar - 'a' + 1); i++) {
    printline(n, s + (char)('a' + i), ('a' + i));
  }
  if (s != "") printline(n, s + (char)(maxchar + 1), maxchar + 1);
}
signed main() {
  long long N;
  cin >> N;
  printline(N);
}
