#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string k[] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
  cin >> N;
  queue<string> q;
  q.push("a");
  while (!q.empty()) {
    string x = q.front();
    q.pop();
    if (x.length() != N) {
      for (int i = 0; i <= int(x[x.length() - 1] - 'a') + 1; i++) {
        q.push(x + k[i]);
      }
    } else {
      cout << x << endl;
    }
  }
}
