#include <bits/stdc++.h>
using namespace std;
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int jousu(int, int);
int jousu(int x00, int y00) {
  int z00 = 1;
  for (int i = 0; i < y00; i++) {
    z00 *= x00;
  }
  return z00;
}
int keta(int x00) {
  int z00 = x00;
  int w00 = 0;
  while (z00 != 0) {
    z00 /= 10;
    w00++;
  }
  return w00;
}
int modinv(int a, int m) {
  int b = m, u = 1, v = 0;
  while (b) {
    int t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
int main() {
  queue<string> que;
  queue<int> q;
  int n;
  cin >> n;
  que.push("a");
  q.push(1);
  while (que.front().size() <= n - 1) {
    for (int i = 0; i <= q.front(); i++) {
      que.push(que.front() + (char)(97 + i));
      if (i == q.front()) {
        q.push(q.front() + 1);
        continue;
      }
      q.push(q.front());
    }
    que.pop();
    q.pop();
  }
  while (!que.empty()) {
    cout << que.front() << endl;
    que.pop();
  }
}
