#include <bits/stdc++.h>
using namespace std;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const int MAXN = 100000;
const int MAXE = 100000;
const int MAXV = 10000;
const long long INF = 2e18;
const long long MOD = 1e9 + 7;
struct UnionFind {
  vector<int> par, rank;
  UnionFind(int n) : par(n), rank(n) {
    for (int i = 0; i < n; ++i) par[i] = i;
  }
  int root(int x) {
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  void unite(int x, int y) {
    int rx = root(x), ry = root(y);
    if (rx == ry) return;
    if (rank[ry] > rank[rx])
      par[rx] = ry;
    else
      par[ry] = rx;
    if (rank[rx] == rank[ry]) rank[rx]++;
  }
  bool same(int x, int y) { return root(x) == root(y); }
};
vector<long long> fac, inv, finv;
void initcom() {
  fac = inv = finv = vector<long long>(1e6);
  fac[0] = fac[1] = 1;
  inv[1] = 1;
  finv[0] = finv[1] = 1;
  for (long long i = 2; i < 1e6; ++i) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long com(int n, int k) {
  if (n < 0 || k < 0) return 0;
  if (n < k) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
set<string> ans;
int n;
void dfs(string res) {
  if (res.size() == n) {
    ans.insert(res);
    return;
  }
  for (char i = 'a'; i <= res.back() + 1; ++i) {
    dfs(res + i);
  }
}
int main() {
  cin >> n;
  dfs("a");
  for (auto it : ans) cout << it << endl;
  return 0;
}
