#include <bits/stdc++.h>
using namespace std;
int len;
vector<string> v;
void iso(string cur) {
  if (cur.length() == len) {
    v.push_back(cur);
    return;
  }
  for (char i = 'a'; i <= cur[cur.length() - 1] + 1; i++) iso(cur + i);
}
int main() {
  cin >> len;
  iso("a");
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size(); i++) cout << v[i] << endl;
}
