#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  queue<string> q;
  q.push("");
  vector<string> v;
  while (!q.empty()) {
    string s = q.front();
    q.pop();
    if (s.size() == n) {
      v.push_back(s);
      continue;
    }
    for (int i = 0; i < s.size() + 1; ++i) {
      if (s.size() > 0 && s[s.size() - 1] + 2 == 'a' + i) break;
      s.push_back('a' + i);
      q.push(s);
      s.pop_back();
    }
  }
  for (auto &&i : v) cout << i << endl;
}
