#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
ostream& operator<<(ostream& out, const pair<A, B>& a) {
  return out << "(" << a.first << ", " << a.second << ")";
}
template <int>
ostream& operator<<(ostream& os, const vector<int>& v) {
  os << "[";
  for (int i = 0; i < v.size(); ++i) {
    if (v[i] != 1000000001)
      os << v[i];
    else
      os << "INF";
    if (i != v.size() - 1) os << ", ";
  }
  os << "]\n";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = 0; i < v.size(); ++i) {
    os << v[i];
    ;
    if (i != v.size() - 1) os << ", ";
  }
  os << "]\n";
  return os;
}
void rotate(string& s) {
  for (int i = 0; i < s.size(); i++) s[i] = s[i] + 1;
}
int main() {
  {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
  };
  set<string> second;
  int n;
  cin >> n;
  second.insert("a");
  for (int i = 2; i <= n; i++) {
    set<string> temp;
    for (auto it : second) {
      string s = it;
      temp.insert("a" + s);
      rotate(s);
      s = "a" + s;
      temp.insert(s);
    }
    swap(second, temp);
  }
  for (auto it : second) cout << it << endl;
  return 0;
}
