#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string cur(n, '-');
  function<void(int, int)> generate = [&](int i, int lim) {
    if (i == n) {
      cout << cur << '\n';
      return;
    }
    for (int c = 0; c <= lim; c++) {
      cur[i] = 'a' + c;
      generate(i + 1, max(lim, c + 1));
    }
  };
  generate(0, 0);
  return 0;
}
