#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using P = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
struct nvec : public vector<int> {
  int base;
  nvec(int len, int base) : vector<int>(len), base(base) {}
  nvec& operator++() {
    for (int i = 0; i < size(); i++) {
      at(i)++;
      if (at(i) < base) break;
      at(i) = 0;
    }
    return *this;
  };
  nvec& operator++(int dummy) { return operator++(); };
};
void solve() {
  int n;
  cin >> n;
  vi a(n);
  function<void(int)> dfs = [&](int u) {
    ;
    if (u == n) {
      ;
      for (int i = 0; i < (n); i++) cout << (char)('a' + a[i]);
      cout << endl;
      return;
    }
    for (int v = 0; v < (u + 1); v++) {
      a[u] = v;
      dfs(u + 1);
    }
  };
  dfs(0);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  solve();
  return 0;
}
