#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
template <class TH>
void _dbg(const char* sdbg, TH h) {
  cerr << sdbg << "=" << h << "\n";
}
template <class TH, class... TA>
void _dbg(const char* sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << "=" << h << ",";
  _dbg(sdbg + 1, a...);
}
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[";
  for (auto vv : V) os << vv << ",";
  return os << "]";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}
int n;
vector<string> normal;
void bt(string s) {
  if ((int)s.size() == n) {
    normal.push_back(s);
    return;
  }
  bt(s + "a");
  if (s.size() > 2 - 1 - 1) {
    bt(s + "b");
  }
  if (s.size() > 3 - 1 - 1) {
    bt(s + "c");
  }
  if (s.size() > 4 - 1 - 1) {
    bt(s + "d");
  }
  if (s.size() > 5 - 1 - 1) {
    bt(s + "e");
  }
  if (s.size() > 6 - 1 - 1) {
    bt(s + "f");
  }
  if (s.size() > 7 - 1 - 1) {
    bt(s + "g");
  }
  if (s.size() > 8 - 1 - 1) {
    bt(s + "h");
  }
  if (s.size() > 9 - 1 - 1) {
    bt(s + "i");
  }
  if (s.size() > 10 - 1 - 1) {
    bt(s + "j");
  }
}
pair<vector<pair<int, int>>, vector<pair<int, int>>> gen(string& a, string& b) {
  vector<pair<int, int>> eq, neq;
  for (int i = 0; i < (int)a.size(); ++i) {
    for (int j = i + 1; j < (int)b.size(); ++j) {
      if (a[i] == a[j] && b[i] != a[j]) {
        return {{{-1, -1}}, {{-1, -1}}};
      }
      if (a[i] == a[j]) {
        eq.push_back({i, j});
      } else {
        neq.push_back({i, j});
      }
    }
  }
  return {eq, neq};
}
int main() {
  cin >> n;
  bt("");
  sort(normal.begin(), normal.end());
  map<pair<vector<pair<int, int>>, vector<pair<int, int>>>, string> mapa;
  for (int i = 0; i < (int)normal.size(); ++i) {
    for (int j = i; j < (int)normal.size(); ++j) {
      auto cc = gen(normal[i], normal[j]);
      if (!mapa.count(cc)) {
        mapa[cc] = normal[i];
      }
    }
  }
  mapa.erase({{{-1, -1}}, {{-1, -1}}});
  set<string> res;
  for (auto x : mapa) {
    res.insert(x.second);
  }
  for (auto x : res) {
    cout << x << endl;
  }
}
