#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  queue<string> que, ans;
  string temp = "a";
  que.push(temp);
  while (que.size()) {
    string t = que.front();
    que.pop();
    if (t.length() == n) {
      ans.push(t);
      continue;
    }
    if (t.at(t.length() - 1) != 'a')
      que.push(t + (char)(t.at(t.length() - 1) - 1));
    que.push(t + (char)(t.at(t.length() - 1)));
    que.push(t + (char)(t.at(t.length() - 1) + 1));
  }
  while (ans.size()) {
    string s = ans.front();
    ans.pop();
    cout << s << endl;
  }
}
