#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
using Pll = pair<P, long long>;
using PQ = priority_queue<P, vector<P>, greater<P>>;
const long long MOD = 1e9 + 7;
long long n;
vector<char> c(10);
void dfs(long long k) {
  if (k == n) {
    for (long long i = 0; i < n; i++) {
      cout << c[i];
    }
    cout << endl;
    return;
  }
  for (long long i = 0; i < k + 1; i++) {
    c[k] = 'a' + i;
    dfs(k + 1);
  }
}
signed main() {
  cin >> n;
  c[0] = 'a';
  dfs(1);
  return 0;
}
