#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  queue<pair<string, int>> q;
  q.push({"", 0});
  while (!q.empty()) {
    auto tmp = q.front();
    q.pop();
    string now = tmp.first;
    if (now.size() == N) {
      cout << now << endl;
      continue;
    }
    int cnt = tmp.second;
    for (int i = 0; i <= cnt; i++) {
      string next = now + char('a' + i);
      bool flag = true;
      vector<int> n(cnt + 2, 0);
      for (int i = 0; i < next.size(); i++) {
        n[next[i] - 'a']++;
      }
      int nmax = 0;
      for (int i = 1; i < cnt + 2; i++)
        if (n[nmax] < n[i]) nmax = i;
      if (nmax != 0) flag = false;
      if (flag) q.push({next, ((i < cnt) ? cnt : cnt + 1)});
    }
  }
}
