#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string alphabet = "abcdefghijklmnopqrstuvwxyz";
  queue<string> que;
  que.push("a");
  map<char, int> mp;
  for (int i = 0; i < 26; i++) {
    mp[alphabet[i]] = i;
  }
  while (true) {
    string s = que.front();
    if ((int)s.size() == N) {
      break;
    }
    que.pop();
    char l = s[s.size() - 1];
    for (int i = 0; i <= mp[l] + 1; i++) {
      que.push(s + alphabet[i]);
    }
  }
  while (!que.empty()) {
    string s = que.front();
    que.pop();
    cout << s << endl;
  }
}
