#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9 + 7;
constexpr lint mod2 = 998244353;
int nya(string s) {
  set<char> u;
  for (int i = 0; i < s.size(); ++i) u.insert(s[i]);
  return u.size();
}
int main() {
  int n;
  cin >> n;
  vector<queue<string>> v(10);
  v[0].push("a");
  for (int i = 0; i < n - 1; ++i) {
    while (!v[i].empty()) {
      string tmp = v[i].front();
      v[i].pop();
      for (int j = 0; j < nya(tmp); ++j) {
        string t = tmp;
        t += (char)'a' + j;
        v[i + 1].push(t);
      }
    }
  }
  while (!v[n - 1].empty()) {
    cout << v[n - 1].front() << endl;
    v[n - 1].pop();
  }
  return 0;
}
