#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
lint power(lint x, lint n, lint mod) {
  lint ret = 1;
  while (n > 0) {
    if (n & 1) (ret *= x) %= mod;
    (x *= x) %= mod;
    n >>= 1;
  }
  return ret;
}
int main() {
  int N;
  cin >> N;
  vector<string> ans;
  for (int i = (0), i_end_ = (power(2, N - 1, MOD)); i < i_end_; i++) {
    string s = "";
    char c = 'a';
    for (int j = (0), j_end_ = (N); j < j_end_; j++) {
      s += c;
      if (j != N - 1 && ((i >> j) & 1) == 1) {
        c++;
      }
    }
    ans.push_back(s);
  }
  sort(ans.begin(), ans.end());
  for (int i = (0), i_end_ = (ans.size()); i < i_end_; i++)
    cout << ans[i] << endl;
}
