#include <bits/stdc++.h>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
template <ostream& out = cout, class... T>
void printde(T&&...) {}
template <ostream& out = cout, class... T>
void printdbe(T&&...) {}
template <ostream& out = cout, class... T>
void printdwe(T&&...) {}
template <ostream& out = cout, class... T>
void printdu(T&&...){};
template <template <class T, class = std::allocator<T>> class V, class E>
istream& operator>>(istream& in, V<E>& v) {
  for (auto& e : v) {
    in >> e;
  }
  return in;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<string> ss;
  ss.push_back("a");
  for (int i = 1; i < n; i++) {
    vector<string> next;
    for (auto& s : ss) {
      for (int j = -1; j < i; j++) {
        next.push_back("a");
        for (auto& c : s) {
          next.back() += c == 'a' + j ? c : c + 1;
        }
      }
    }
    next.swap(ss);
  }
  set<string> st(ss.begin(), ss.end());
  for (auto& s : st) {
    cout << s << '\n';
  }
}
