#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  lint n;
  cin >> n;
  lint ans, tmp;
  queue<string> q;
  q.push("a");
  for (int i = (0), i_end_ = (n - 1); i < i_end_; i++) {
    int max_s = 0;
    while (1) {
      string s = q.front();
      if (((lint)(s).size()) == i + 2) {
        break;
      }
      q.pop();
      for (int j = (0), j_end_ = (((lint)(s).size())); j < j_end_; j++) {
        max_s = max((int)s[j], max_s);
      }
      for (int j = (0), j_end_ = (max_s - 'a' + 2); j < j_end_; j++) {
        string s_push = s + (char)('a' + j);
        q.push(s_push);
      }
    }
  }
  while (!q.empty()) {
    string s = q.front();
    q.pop();
    cout << s << "\n";
  }
  return 0;
}
