#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
using PII = std::pair<int, int>;
using PLL = std::pair<ll, ll>;
const int mod = 1e9 + 7;
const string wsp = " ";
const string tb = "\t";
const string rt = "\n";
template <typename T>
void show1dvec(vector<T> v) {
  if (v.size() == 0) return;
  int n = v.size() - 1;
  for (int i = 0; i < (int)(n); i++) cout << v[i] << wsp;
  cout << v[n] << rt;
  return;
}
template <typename T>
void show2dvec(vector<vector<T>> v) {
  int n = v.size();
  for (int i = 0; i < (int)(n); i++) show1dvec(v[i]);
}
vector<string> adding(vector<string> &vs) {
  char c;
  string y;
  vector<string> ret;
  for (auto z : vs) {
    c = z[z.length() - 1];
    y = z;
    y += c;
    ret.push_back(y);
    c++;
    y = z;
    y += c;
    ret.push_back(y);
  }
  sort((ret).begin(), (ret).end());
  return ret;
}
int main() {
  int n;
  cin >> n;
  vector<string> vs;
  vs.push_back("a");
  for (int i = 0; i < (int)(n - 1); i++) vs = adding(vs);
  for (auto z : vs) cout << z << rt;
  return 0;
}
