#include <bits/stdc++.h>
using namespace std;
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (T &x : vec) is >> x;
  return is;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "{";
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  }
  os << "}";
  return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
  os << "{";
  for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
    os << *itr;
    itr++;
    if (itr != map_var.end()) os << ", ";
    itr--;
  }
  os << "}";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
  os << "{";
  for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
    os << *itr;
    itr++;
    if (itr != set_var.end()) os << ", ";
    itr--;
  }
  os << "}";
  return os;
}
void dump_func() { cout << endl; }
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&...tail) {
  cout << head;
  if (sizeof...(Tail) > 0) {
    cout << ", ";
  }
  dump_func(std::move(tail)...);
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
struct aaa {
  aaa() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
  };
} aaaaaaa;
signed main() {
  int N;
  cin >> N;
  queue<string> Q;
  Q.push("a");
  for (int i = 0, i_len = (N - 1); i < i_len; ++i) {
    queue<string> nQ;
    while (!Q.empty()) {
      string s = Q.front();
      Q.pop();
      for (char c = s[i] + 1; c >= 'a'; c--) {
        nQ.push(s + c);
      }
    }
    nQ.swap(Q);
  }
  vector<string> ans;
  while (!Q.empty()) {
    string s = Q.front();
    Q.pop();
    ans.push_back(s);
  }
  sort((ans).begin(), (ans).end());
  for (string s : ans) {
    cout << s << endl;
  }
  return 0;
}
