#include <bits/stdc++.h>
using namespace std;
int N;
void search(string s, int count) {
  int L = s.size();
  if (L == N) {
    cout << s << endl;
    ;
    return;
  }
  for (int x = 0; x < (count); x++) {
    char c = ('a' + x);
    search(s + c, x == L ? count + 1 : count);
  }
}
int main() {
  cin >> N;
  search("", 1);
  return 0;
}
