#include <bits/stdc++.h>
using namespace std;
long long n;
void dfs(string s) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  char mn = 'a';
  for (long long i = (0); i < (long long)(s.size()); i++) {
    mn = min(mn, s[i]);
  }
  for (char i = 'a'; i < mn + 2; i++) {
    string tmp(s);
    tmp.push_back(i);
    dfs(tmp);
  }
}
int main() {
  cin >> n;
  dfs("a");
  return 0;
}
