#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  queue<string> A;
  A.push("a");
  if (N == 1) {
    cout << 'a' << endl;
    return 0;
  }
  while (1) {
    string s = A.front();
    if (s.size() == N) {
      break;
    }
    A.pop();
    char c = s.back();
    char d = c + 1;
    for (char k = 'a'; k <= c; k++) {
      string f = s + k;
      A.push(f);
      if (f.size() == N) {
        cout << f << endl;
      }
    }
    string h = s + d;
    A.push(h);
    if (h.size() == N) {
      cout << h << endl;
    }
  }
  return 0;
}
