#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll i, j, k;
ll n;
ll powll(ll a, ll n) {
  if (n == 0) {
    return 1;
  }
  return powll(a, n - 1) * a;
}
void f(ll rest, string s) {
  if (rest == 0) {
    cout << s << endl;
  } else {
    for (char c = 'a'; int(c) <= int('a' + n - rest); c++) {
      f(rest - 1, s + c);
    }
  }
}
int main() {
  ll i, j, k;
  ll n;
  string r;
  cin >> n;
  f(n, "");
}
