#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
using V = std::vector<T>;
using Vi = V<int>;
using VVi = V<V<int>>;
using Vl = V<ll>;
using VVl = V<V<ll>>;
using Vs = V<string>;
template <typename T1, typename T2>
using P = std::pair<T1, T2>;
using Pii = P<int, int>;
using Pll = P<ll, ll>;
using Pdd = P<double, double>;
template <typename T1, typename T2>
using M = std::map<T1, T2>;
using Mii = M<int, int>;
using Mll = M<ll, ll>;
using Msi = M<string, int>;
const double PI = acos(-1);
const ll MOD = 1e9 + 7;
int n;
Vi v;
void dfs(int depth) {
  if (depth == n) {
    for (int i = 0; i < (int)(n); ++i) cout << (char)('a' + v[i]);
    cout << '\n';
    return;
  }
  for (int i = 0; i < (int)(v[depth - 1] + 2); ++i) {
    v[depth] = i;
    dfs(depth + 1);
  }
}
int main() {
  cin >> n;
  v = Vi(n);
  v[0] = 0;
  dfs(1);
  return 0;
}
