#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
const long long inf = 1ll << 60;
const long long iinf = 2147483647;
const long long mod = 1e9 + 7;
const long long maxn = 5e3;
long long pw(long long x, long long p) {
  long long ret = 1;
  while (p > 0) {
    if (p & 1) {
      ret *= x;
      ret %= mod;
    }
    x *= x;
    x %= mod;
    p >>= 1;
  }
  return ret;
}
long long inv(long long x) { return pw(x, mod - 2); }
long long n;
vector<string> ans;
void bt(string cur, long long siz) {
  if (siz >= n - 1) {
    ans.push_back(cur);
    return;
  }
  char num = cur[siz];
  bt(cur + num, siz + 1);
  num++;
  bt(cur + num, siz + 1);
  return;
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  bt("a", 0);
  for (long long i = (0); i < ((long long)(ans.size())); i++) {
    cout << ans[i] << '\n';
  }
}
