#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return abs(a * b) / gcd(a, b); }
vector<ll> enum_div(ll n) {
  vector<ll> ret;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i != 1 && i * i != n) ret.push_back(n / i);
    }
  }
  ret.push_back(n);
  return ret;
}
vector<bool> IsPrime;
void sieve(size_t max) {
  if (max + 1 > IsPrime.size()) IsPrime.resize(max + 1, true);
  IsPrime[0] = false;
  IsPrime[1] = false;
  for (size_t i = 2; i * i <= max; ++i)
    if (IsPrime[i])
      for (size_t j = 2; i * j <= max; ++j) IsPrime[i * j] = false;
}
void solve(long long N) {
  string a = "", b = "";
  vector<string> ans;
  for (int i = 0; i < N; i++) {
    a += 'a';
    b += 'a';
  }
  ans.push_back(a);
  for (int i = 0; i < N - 1; i++) {
    a = b;
    for (int l = 0; l < N - i - 1; l++) {
      for (int n = 0; n < i + 1; n++) {
        a[l + n] = 'a' + (n + 1);
      }
      reverse((a).begin(), (a).end());
      ans.push_back(a);
    }
  }
  sort((ans).begin(), (ans).end());
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
int main() {
  long long N;
  scanf("%lld", &N);
  solve(N);
}
