#include <bits/stdc++.h>
using namespace std;
vector<string> vs;
void load(int n, string s, int cur) {
  if (cur == n) {
    vs.push_back(s);
    return;
  }
  char lst = s.back();
  ++lst;
  for (char ch = 'a'; ch <= lst; ch++) {
    load(n, s + ch, cur + 1);
  }
}
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a";
    return 0;
  }
  load(n - 1, "a", 0);
  sort(vs.begin(), vs.end());
  for (int i = 0; i < vs.size(); i++) {
    cout << vs[i] << "\n";
  }
  return 0;
}
