#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
vector<string> v;
int main() {
  ll n;
  cin >> n;
  queue<string> q;
  q.push("a");
  while (!q.empty()) {
    string s = q.front();
    q.pop();
    if (s.size() > n) break;
    if ((ll)s.size() == n) {
      v.push_back(s);
    }
    string tmp = s;
    char pc = s.back() - 1;
    char nc = s.back() + 1;
    if (s.back() != 'a') {
      tmp.push_back(pc);
      q.push(tmp);
    }
    tmp = s;
    tmp.push_back(s.back());
    q.push(tmp);
    if (s.back() != 'z') {
      tmp = s;
      tmp.push_back(nc);
      q.push(tmp);
    }
  }
  sort(v.begin(), v.end());
  for (auto p : v) {
    cout << p << '\n';
  }
  return 0;
}
