#include <bits/stdc++.h>
using namespace std;
static const long long max_n = 200010;
string alphabet = "abcdefghijklmnop";
map<char, long long> alphabet_idx;
long long N, X, Y;
int main() {
  scanf("%lld", &N);
  for (auto s : alphabet) {
    alphabet_idx[s] = alphabet_idx.size();
  }
  queue<string> Q;
  Q.push("a");
  set<string> S;
  while (Q.front().size() < N) {
    string top = Q.front();
    Q.pop();
    long long size = top.size();
    long long max_size = 0;
    for (auto s : top) {
      max_size = max(max_size, alphabet_idx[s]);
    }
    for (long long i = 0; i <= max_size + 1; i++) {
      string new_top = top + alphabet[i];
      Q.push(new_top);
      if (new_top.size() == N) {
        S.insert(new_top);
      }
    }
  }
  if (N == 1) {
    S.insert("a");
  }
  for (auto s : S) {
    for (auto c : s) {
      printf("%c", c);
    }
    printf("\n");
  }
}
