#include <bits/stdc++.h>
using namespace std;
using uint = uint32_t;
using LL = int64_t;
using ULL = uint64_t;
using PP = pair<LL, LL>;
template <typename T>
using PriorityQ = priority_queue<T, vector<T>, greater<T> >;
const int INF = 0x3FFFFFFF;
const LL INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const double EPS = 1.0e-9;
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
template <class T, class U>
istream& operator>>(istream& ist, pair<T, U>& right) {
  return ist >> right.first >> right.second;
}
template <class T, class U>
ostream& operator<<(ostream& ost, const pair<T, U>& right) {
  return ost << right.first << ' ' << right.second;
}
template <class T, class TCompatible, size_t N>
void Fill(T (&dest)[N], const TCompatible& val) {
  fill(dest, dest + N, val);
}
template <class T, class TCompatible, size_t M, size_t N>
void Fill(T (&dest)[M][N], const TCompatible& val) {
  for (int i = 0; i < M; ++i) Fill(dest[i], val);
}
template <class T>
T Next() {
  T buf;
  cin >> buf;
  return buf;
}
istream& Ignore(istream& ist) {
  string s;
  ist >> s;
  return ist;
}
bool Inside(int i, int j, int h, int w) {
  return i >= 0 && i < h && j >= 0 && j < w;
}
istream& operator>>(istream& ist, __int128& val) {
  LL tmp;
  ist >> tmp;
  val = tmp;
  return ist;
}
ostream& operator<<(ostream& ost, __int128 val) {
  LL tmp = val;
  ost << tmp;
  return ost;
}
int N;
vector<string> vec;
void rec(int k, string& s) {
  if (k == 0) {
    vec.push_back(s);
    return;
  }
  for (LL c = ('a'), c_max_ = (s.back() + 2); c < c_max_; ++c) {
    s += c;
    rec(k - 1, s);
    s.pop_back();
  }
}
int main() {
  cin >> N;
  string s = "a";
  rec(N - 1, s);
  sort(vec.begin(), vec.end());
  for (auto&& t : vec) {
    cout << t << endl;
  }
  return 0;
}
