#include <bits/stdc++.h>
using namespace std;
template <class Abel>
struct UnionFind {
  vector<long long> par;
  vector<long long> rank;
  vector<Abel> diff_weight;
  UnionFind(long long n = 1, Abel SUM_UNITY = 0) { init(n, SUM_UNITY); }
  void init(long long n = 1, Abel SUM_UNITY = 0) {
    par.resize(n);
    rank.resize(n);
    diff_weight.resize(n);
    for (long long i = 0; i < n; ++i)
      par[i] = i, rank[i] = 0, diff_weight[i] = SUM_UNITY;
  }
  long long root(long long x) {
    if (par[x] == x)
      return x;
    else {
      long long r = root(par[x]);
      diff_weight[x] += diff_weight[par[x]];
      return par[x] = r;
    }
  }
  Abel weight(long long x) {
    root(x);
    return diff_weight[x];
  }
  bool issame(long long x, long long y) { return root(x) == root(y); }
  bool unite(long long x, long long y, Abel w) {
    w += weight(x);
    w -= weight(y);
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (rank[x] < rank[y]) swap(x, y), w = -w;
    if (rank[x] == rank[y]) ++rank[x];
    par[y] = x;
    diff_weight[y] = w;
    return true;
  }
  Abel diff(long long x, long long y) { return weight(y) - weight(x); }
};
const int mod = 1e9 + 7;
const double pi = acos(-1);
long long cei(long long x, long long y) {
  long long ans = x / y;
  if (x % y != 0) ans++;
  return ans;
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long llpow(long long x, long long n) {
  long long ans = 1, i;
  for ((i) = (0); (i) < (n); (i)++) {
    ans *= x;
    ans %= mod;
  }
  return ans;
}
long long modpow(long long x, long long n) {
  long long ans = x, i, tmp = x, t1 = 1;
  i = 1;
  while (i < n) {
    if (i * 2 < n) {
      ans *= ans;
      ans %= mod;
      i *= 2;
    } else {
      t1 = 1;
      tmp = x;
      while (t1 * 2 < n - i) {
        tmp *= tmp;
        tmp %= mod;
        t1 *= 2;
      }
      ans *= tmp;
      ans %= mod;
      i += t1;
    }
  }
  return ans;
}
long long fact(long long x) {
  long long i, ans = 1;
  for ((i) = (0); (i) < (x); (i)++) {
    ans *= (x - i);
    ans %= mod;
  }
  return ans;
}
long long inv(long long x) { return modpow(x, mod - 2); }
long long ncr(long long n, long long r) {
  long long a = fact(n), b = modpow(fact(n - r), mod - 2),
            c = modpow(fact(r), mod - 2);
  long long ans = a * b;
  ans %= mod;
  ans *= c;
  ans %= mod;
  return ans;
}
long long npr(long long n, long long r) {
  long long a = fact(n), b = modpow(fact(n - r), mod - 2);
  return (a * b) % mod;
}
bool prime(long long a) {
  if (a <= 1) return false;
  long long i;
  for (i = 2; i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
long long fib(long long x) {
  long long i, fibo[x + 10];
  fibo[0] = 1;
  fibo[1] = 1;
  fibo[2] = 1;
  for ((i) = (3); (i) < (x + 1); (i)++) fibo[i] = fibo[i - 1] + fibo[i - 2];
  return fibo[x];
}
long long dig(long long n) {
  long long d = 0, tmp = n;
  while (tmp / 10 > 0) {
    tmp /= 10;
    d++;
  }
  return d;
}
void matcpy(long long a[21][21], long long b[21][21]) {
  long long i, j;
  for ((i) = (0); (i) < (21); (i)++)
    for ((j) = (0); (j) < (21); (j)++) b[i][j] = a[i][j];
}
void matrst(long long a[21][21]) {
  long long i, j;
  for ((i) = (0); (i) < (21); (i)++)
    for ((j) = (0); (j) < (21); (j)++) a[i][j] = 0;
}
void matpow(long long a[21][21]) {
  long long ans[21][21];
  matrst(ans);
  long long i, j, k;
  for ((i) = (0); (i) < (21); (i)++)
    for ((j) = (0); (j) < (21); (j)++)
      for ((k) = (0); (k) < (21); (k)++) {
        ans[i][j] += a[i][k] * a[k][j];
        ans[i][j] %= mod;
      }
  matcpy(ans, a);
}
void matmul(long long a[21][21], long long b[21][21], long long as[21][21]) {
  long long i, j, k;
  matrst(as);
  for ((i) = (0); (i) < (21); (i)++)
    for ((j) = (0); (j) < (21); (j)++)
      for ((k) = (0); (k) < (21); (k)++) {
        as[i][j] += a[i][k] * b[k][j];
        as[i][j] %= mod;
      }
}
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
long long i, j;
long long n;
vector<string> s;
void solve(long long a, string str) {
  if (a + 1 < n) solve(a + 1, str);
  str[a]++;
  s.push_back(str);
  if (a + 1 < n) solve(a + 1, str);
}
int main() {
  cin >> n;
  string t;
  for ((i) = (0); (i) < (n); (i)++) t += 'a';
  s.push_back(t);
  if (n > 1) solve(1, t);
  sort(s.begin(), s.end());
  for ((i) = (0); (i) < (s.size()); (i)++) cout << s.at(i) << endl;
  return 0;
}
