#include <bits/stdc++.h>
using namespace std;
int N;
void put(string s, char used, int n) {
  for (char c = 'a'; c <= used; c++) {
    string ss = s + c;
    if (n == N - 1) {
      cout << ss << endl;
    } else {
      put(ss, used, n + 1);
    }
  }
  char next = (char)(used + 1);
  if (n == N - 1) {
    cout << s + next << endl;
  } else {
    put(s + next, next, n + 1);
  }
}
int main(void) {
  cin >> N;
  if (N == 1) cout << "a" << endl;
  put("a", 'a', 1);
  return 0;
}
