#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++) {
    dfs(i, dep + 1, t + i);
  }
}
int main() {
  cin >> n;
  dfs('a', 1, "a");
  for (auto x : s) cerr << x << endl;
  return 0;
}
