#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 {
    string A = S, B = S;
    long long C = S.size();
    char D = S[C - 1];
    func(A + D);
    D++;
    func(B + D);
  }
}
signed main() {
  cin >> N;
  string _ = "a";
  func(_);
  for (auto p : T) cout << p << endl;
}
