#include <bits/stdc++.h>
using namespace std;
void helper(string s, int max_v, int N) {
  if (s.size() == N) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i <= max_v; i++) {
    helper(s + char('a' + i), max(max_v, i + 1), N);
  }
}
int main() {
  int N;
  cin >> N;
  if (N == 1) {
    cout << "a" << endl;
    return 0;
  }
  helper("a", 1, N);
}
