#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
ostream &operator<<(ostream &os, const P &p) {
  return os << "(" << p.first << "," << p.second << ")";
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (long long i = 0; i < v.size(); i++) os << (i ? "," : "[") << v[i];
  os << "]";
  return os;
}
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
const long long INF = 1e+18;
const double EPS = 1e-9;
const long long MOD = 1000000007;
const long long dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
vector<string> vec;
string tmp;
long long n;
void dfs(long long x) {
  if (x == n) {
    cout << tmp << endl;
    return;
  }
  tmp.push_back(' ');
  for (long long i = 0; i <= x; i++) {
    tmp[x] = (char)('a' + i);
    dfs(x + 1);
  }
}
signed main() {
  cin >> n;
  dfs(0);
}
