#include <bits/stdc++.h>
using namespace std;
char s[256];
void resolve(char c, int p, int pv, int n) {
  if (!n) {
    puts(s);
    return;
  }
  for (int k = min(pv, n); k > 0; --k) {
    for (int i = 0; i < k; ++i) {
      s[p + i] = c;
    }
    resolve(c + 1, p + k, k, n - k);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  s[n] = '\0';
  resolve('a', 0, n, n);
  return 0;
}
