#include <bits/stdc++.h>
using namespace std;
void YES(bool flag) { cout << (flag ? "YES" : "NO") << endl; }
void Yes(bool flag) { cout << (flag ? "Yes" : "No") << endl; }
void yes(bool flag) { cout << (flag ? "yes" : "no") << endl; }
const int INF = 1e7;
const long long MOD = 1e9 + 7;
set<string> w;
int n;
void add_str(int len, int level, string s) {
  if (len >= n) {
    w.insert(s);
    return;
  }
  for (long long i = 0; i < level + 2; i++) {
    string tmp(s);
    tmp += (char)('a' + i);
    add_str(len + 1, i, tmp);
  }
}
int main() {
  cin >> n;
  add_str(1, 0, "a");
  for (auto itr = (w).begin(); itr != (w).end(); itr++) {
    cout << *itr << endl;
  }
  return 0;
}
