#include <bits/stdc++.h>
using namespace std;
vector<char> moji = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
set<string> sts;
int solve(string str, int tmp, int cnt, int n) {
  if (tmp == n) {
    sts.insert(str);
    return 0;
  }
  for (int i = 0; i <= cnt; i++) {
    solve(str + moji[i], tmp + 1, i + 1, n);
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a\n";
    return 0;
  }
  solve("a", 1, 1, n);
  for (auto& s : sts) cout << s << "\n";
}
