#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
string s;
void print_str(int n, int i, int num, char c, set<string>* cont);
int main() {
  int n;
  cin >> n;
  s.resize(n);
  for (int i = 0; i < n; i++) {
    s[i] = 'a';
  }
  set<string> cont;
  print_str(n, 0, 1, 'a', &cont);
  for (auto i = (cont).begin(); i != (cont).end(); i++) {
    cout << *i << endl;
  }
  return 0;
}
void print_str(int n, int i, int num, char c, set<string>* cont) {
  if (n == i) {
    cont->insert(s);
    return;
  }
  s[i] = c;
  for (int j = 0; j <= num; ++j) {
    print_str(n, i + 1, (j < num ? num : num + 1), j + 'a', cont);
  }
}
