#include <bits/stdc++.h>
using namespace std;
vector<string> res;
int n;
void dfs(int i, char c, string s) {
  s.push_back(c);
  if (i == n) {
    res.push_back(s);
    return;
  }
  int x = c - 'a';
  for (int j = 0; j < x + 2; ++j) {
    char cc = 'a' + j;
    dfs(i + 1, cc, s);
  }
}
int main() {
  cin >> n;
  dfs(1, 'a', "");
  sort(res.begin(), res.end());
  for (int i = 0; i < res.size(); ++i) cout << res[i] << "\n";
  return 0;
}
