#include <bits/stdc++.h>
using namespace std;
template <class T>
bool getlinev(vector<T> &arr) {
  arr.clear();
  string str;
  getline(cin, str);
  stringstream s(str);
  T t;
  while (s) {
    s >> t;
    arr.push_back(t);
  }
  return true;
}
template <class T>
void printv(vector<T> &arr) {
  for (T e : arr) printf("%d ", e);
  puts("");
}
void normalForm(int target, int cur, string s) {
  if (cur > target) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i < cur; i++) {
    if (s.length() && 'a' + i - s[s.length() - 1] > 1) continue;
    normalForm(target, cur + 1, s + (char)('a' + i));
  }
}
int main() {
  int N;
  cin >> N;
  normalForm(N, 1, "");
  return 0;
}
