#include <bits/stdc++.h>
using namespace std;
long long n;
vector<string> ans;
void dfs(string s) {
  long long l = s.size();
  if (l == n) {
    ans.push_back(s);
    return;
  }
  char last = s[l - 1];
  char po = last + 1;
  string x = s + last, y = s + po;
  dfs(x);
  dfs(y);
  return;
}
long long bcount(long long x) {
  long long cnt = 1;
  for (long long i = 0; i < x; i++) cnt *= 2;
  return cnt;
}
signed main() {
  cin >> n;
  dfs("a");
  long long t = bcount(n - 1);
  for (long long i = 0; i < t; i++) {
    cout << ans[i] << endl;
  }
  cout << ans[0] << endl;
  return 0;
}
