#include <bits/stdc++.h>
using namespace std;
long long N;
set<string> T;
void func(string S) {
  if (S.size() == N)
    T.insert(S);
  else {
    long long C = S.size();
    char D = S[C - 1] + 1;
    for (char i = 'a'; i <= D; i++) {
      string X = S + i;
      func(X);
    }
  }
}
signed main() {
  cin >> N;
  string _ = "a";
  func(_);
  for (auto p : T) cout << p << endl;
}
