#include <bits/stdc++.h>
using namespace std;
void dfs(const int& n, string s, vector<string>& ss) {
  if (s.size() == n) {
    ss.push_back(s);
    return;
  }
  for (int i = 0; i < s.back() - 'a' + 2; i++) dfs(n, s + (char)('a' + i), ss);
}
int main() {
  int n;
  cin >> n;
  vector<string> ss;
  dfs(n, "a", ss);
  for (auto s : ss) cout << s << endl;
}
