#include <bits/stdc++.h>
using namespace std;
int test(int n, int now, int max, string sum);
char *s = "abcdefghij";
int test(int n, int now, int max, string sum) {
  for (int i = 0; i < max + 1; i++) {
    if (now < n - 1) {
      test(n, now + 1, i + 1, sum + s[i]);
    } else
      cout << sum << s[i] << endl;
  }
}
int main() {
  int n;
  cin >> n;
  test(n, 0, 0, "");
  return 0;
}
