#include <bits/stdc++.h>
using namespace std;
vector<string> R(0);
void f(string s, int N) {
  if (s.size() == N) {
    R.push_back(s);
    return;
  }
  f(s + s.at(s.size() - 1), N);
  char cnext = s.at(s.size() - 1) + 1;
  f(s + cnext, N);
  return;
}
int main() {
  int N;
  cin >> N;
  f("a", N);
  for (string s : R) {
    cout << s << endl;
  }
}
