#include <bits/stdc++.h>
using namespace std;
int N;
void recurse(string current) {
  if (current.length() == N) {
    cout << current << endl;
    return;
  }
  int lastCharIndex = current[current.length() - 1] - 'a';
  for (int c = 0; c <= lastCharIndex + 1; c++)
    recurse(current + (char)(c + 'a'));
}
int main() {
  cin >> N;
  recurse("a");
}
