#include <bits/stdc++.h>
using namespace std;
int n;
void backtr(int k, int v[]) {
  if (k == n + 1) {
    for (int i = 1; i <= n; i++) cout << (char)('a' - 1 + v[i]);
    cout << '\n';
    return;
  }
  for (int i = 1; i <= v[k - 1] + 1; i++) {
    v[k] = i;
    backtr(k + 1, v);
  }
}
int main() {
  cin >> n;
  if (n == 1) {
    cout << "a";
    return 0;
  }
  int v[n + 2];
  v[1] = 1;
  backtr(2, v);
  return 0;
}
