#include <bits/stdc++.h>
using namespace std;
long long int level;
set<string> ans;
void func1(char ch, long long int l, string s) {
  if (l > level) {
    string s1 = 'a' + s;
    ans.insert(s1);
    return;
  }
  for (long long int i = 0; i <= (ch - 'a') + 1; i++) {
    char t1 = 'a' + i;
    func1(t1, l + 1, s + t1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> level;
  if (level == 1) {
    cout << "a";
  } else {
    level--;
    func1('a', 1, "");
    for (auto itr = ans.begin(); itr != ans.end(); itr++) {
      cout << *itr << "\n";
    }
  }
  return 0;
}
