#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  vector<vector<string>> v(11);
  v[1].push_back("a");
  for (ll i = 2; i <= n; i++) {
    for (auto x : v[i - 1]) {
      string poo = x;
      poo += "a";
      v[i].push_back(poo);
      poo = x;
      char c = x[x.length() - 1];
      if (c != 'a') {
        poo += c;
        v[i].push_back(poo);
      }
      poo = x;
      c = x[x.length() - 1] + 1;
      poo += c;
      v[i].push_back(poo);
    }
  }
  sort((v[n]).begin(), (v[n]).end());
  for (auto x : v[n]) {
    cout << x << "\n";
  }
}
