#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
void fun1(int N) {
  if (N == 1) {
    cout << "a" << endl;
    return;
  }
  if (N == 2) {
    cout << "aa" << endl;
    cout << "ab" << endl;
    return;
  }
  set<string> ans;
  ans.insert("aa");
  ans.insert("ab");
  for (int i = 3; i <= N; ++i) {
    set<string> currentAns;
    for (auto s : ans) {
      string sCopy = s;
      sCopy.push_back(sCopy[s.length() - 1] + 1);
      currentAns.insert(sCopy);
      for (int i = 0; i < s.length(); ++i) {
        string s1 = s;
        s1.push_back(s[i]);
        currentAns.insert(s1);
      }
    }
    ans = currentAns;
  }
  for (auto s : ans) {
    cout << s << endl;
  }
}
void func() {
  int N;
  cin >> N;
  fun1(N);
}
int main() {
  func();
  return 0;
}
