#include <bits/stdc++.h>
using namespace std;
int64_t INF = 1e18;
int inf = 1e9;
int64_t mod = 1e9 + 7;
int64_t n;
map<string, int64_t> mp;
void rec(vector<int64_t> v, int64_t x) {
  if (x == (1 << n) - 1) {
    sort((v).begin(), (v).end(), greater<int64_t>());
    string add(n, 'a');
    for (int64_t i = 0; i < (int64_t)v.size(); i++) {
      for (int64_t j = 0; j < n; j++) {
        if (v[i] & (1 << j)) {
          add[j] = 'a' + i;
        }
      }
    }
    reverse((add).begin(), (add).end());
    mp[add]++;
  }
  for (int64_t bit = 1; bit < (1 << n); bit++) {
    if (x & bit) continue;
    v.push_back(bit);
    rec(v, x | bit);
    v.pop_back();
  }
}
int main() {
  cin >> n;
  vector<int64_t> v;
  rec(v, 0);
  for (auto i : mp) {
    cout << (i.first) << '\n';
  }
  return 0;
}
