#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > p;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      p.push_back(make_pair(i, j));
    }
  }
  vector<string> ans;
  for (int i = 0; i < (int)(1 << p.size()); i++) {
    string now(n, 'a');
    for (int j = 0; j < (int)(p.size()); j++) {
      int x, y;
      tie(x, y) = p[j];
      if (i >> j & 1) {
        if (now[x] == now[y]) now[y] = now[x] + 1;
      } else {
        if (now[x] != now[y]) now[y] = now[x];
      }
    }
    ans.push_back(now);
  }
  sort(ans.begin(), ans.end());
  map<string, int> mp;
  for (auto x : ans) {
    if (mp[x] == 0) {
      cout << x << endl;
      mp[x] = 1;
    }
  }
}
