#include <bits/stdc++.h>
using namespace std;
vector<string> solve(long long N) {
  if (N == 1) {
    return {"a"};
  }
  vector<string> prev(solve(N - 1));
  long long i;
  vector<string> ret;
  ret.reserve(long long((prev).size()) * 2);
  for (i = (0); i < (long long((prev).size())); ++i) {
    char cl = prev[i][N - 2];
    string a = prev[i];
    a = prev[i].append(1, cl);
    ret.push_back(a);
    a[N - 1] = cl + 1;
    ret.push_back(a);
  }
  return ret;
}
int main(int argc, char *argv[]) {
  long long N;
  cin >> N;
  vector<string> ans = solve(N);
  long long i;
  for (i = (0); i < (long long((ans).size())); ++i) {
    cout << ans[i] << endl;
  }
  return 0;
}
