#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
int N;
int main() {
  cin >> N;
  queue<pair<string, char>> ans;
  ans.push({"a", 'a'});
  for (long long i = 0; i < (N - 1); ++i) {
    while (ans.front().first.size() == i + 1) {
      auto a = ans.front();
      ans.pop();
      for (long long c = 0; c < (a.second - 'a' + 2); ++c) {
        ans.push({a.first + (char)('a' + c), (char)('a' + c)});
      }
    }
  }
  while (!ans.empty()) {
    cout << ans.front().first << endl;
    ans.pop();
  }
  return 0;
}
