#include <bits/stdc++.h>
using namespace std;
long long int use[20];
long long int n;
set<string> ans;
void func(string s, long long int now, char before) {
  if (now == n) {
    cout << s << endl;
    return;
  }
  long long int nowIndex = before - 'a';
  for (long long int i = 0; i < nowIndex + 2; i++) {
    func(s + (char)('a' + i), now + 1, (char)('a' + i));
  }
}
signed main() {
  cin >> n;
  string s = "a";
  func(s, 1, 'a');
  return 0;
}
