#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
void dfs(char now, int n, string s) {
  if (int(s.size()) == n) {
    cout << s << endl;
    return;
  }
  if (s.empty()) {
    dfs('a', n, (string)(s + 'a'));
    return;
  }
  for (char c = 'a'; c <= now + 1; ++c) {
    dfs(c, n, s + c);
  }
  return;
}
int main() {
  int n;
  cin >> n;
  dfs('a', n, "");
  return 0;
}
