#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;
ll mypow(ll x, ll n, ll mod = MOD) {
  ll ret = 1;
  while (n > 0) {
    if (n & 1) {
      ret = (ret * x) % mod;
    }
    x = (x * x) % mod;
    n >>= 1;
  }
  return ret;
}
ll mygcd(ll a, ll b) {
  if (b == 0) return a;
  return mygcd(b, a % b);
}
ll twoPow(ll shiftNum) { return (1LL << (shiftNum - 1)); }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  vector<vector<ll>> x(1, vector<ll>(1, 1));
  for (int i = 1; i < n; i++) {
    vector<vector<ll>> next;
    for (int j = 0; j < x.size(); j++) {
      ll mx = 1;
      for (int k = 0; k < x[j].size(); k++) {
        mx = max(mx, x[j][k]);
      }
      for (int k = 1; k <= mx + 1; k++) {
        vector<ll> tmp = x[j];
        tmp.push_back(k);
        next.push_back(tmp);
      }
    }
    x = next;
  }
  vector<ll> fs;
  for (int i = 0; i < x.size(); i++) {
    ll t = 0;
    for (int j = 0; j < x[i].size(); j++) {
      t *= 10;
      t += x[i][j];
    }
    fs.push_back(t);
  }
  sort(fs.begin(), fs.end());
  for (int i = 0; i < fs.size(); i++) {
    string ans = "";
    deque<char> dq;
    while (fs[i] != 0) {
      dq.push_back('a' + (char)(fs[i] % 10 - 1));
      fs[i] /= 10;
    }
    while (!dq.empty()) {
      ans += dq.back();
      dq.pop_back();
    }
    cout << ans << endl;
  }
  return 0;
}
