#include <bits/stdc++.h>
using namespace std;
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.first << "," << P.second << ")";
}
char t[1003];
set<string> words;
void rec(int nr, int id, char let) {
  if (!nr) return;
  for (char c = 'a'; c <= let; ++c) {
    t[id] = c;
    if (nr == 1) {
      string s = "";
      for (int i = 1; i <= id; ++i) {
        s.push_back(t[i]);
      }
      words.insert(s);
    } else {
      rec(nr - 1, id + 1, let);
    }
  }
}
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  }
  char let = 'a';
  for (int i = 1; i <= n; ++i) {
    t[i] = let;
    rec(n - i, i + 1, let);
    let++;
  }
  for (auto s : words) {
    cout << s << endl;
  }
}
