#include <bits/stdc++.h>
using namespace std;
long long n;
vector<string> ans;
void dfs(string s) {
  long long l = s.size();
  if (l == n) {
    ans.push_back(s);
    return;
  }
  char po = s[l - 1] + 1;
  for (long long i = 0;; i++) {
    char c = 'a' + i;
    if (c > po) break;
    dfs(s + c);
  }
  return;
}
signed main() {
  cin >> n;
  dfs("a");
  long long t = ans.size();
  for (long long i = 0; i < t; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
