#include <bits/stdc++.h>
using namespace std;
int n;
vector<string> s(0);
void dfs(char c, int dep, string t) {
  if (dep == n) {
    s.emplace_back(t);
    return;
  }
  for (char i = 'a'; i <= c + 1; i++) {
    string tmp = t;
    tmp.push_back(i);
    dfs(i, dep + 1, tmp);
  }
  return;
}
int main() {
  cin >> n;
  dfs('a', 1, "a");
  sort(s.begin(), s.end());
  cerr << s.size() << endl;
  for (auto x : s) cout << x << endl;
  return 0;
}
