#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;
  dfs(s + last);
  dfs(s + po);
  return;
}
long long bcount(long long x) {
  long long cnt = 1;
  while (x) {
    cnt *= 2;
    x--;
  }
  return cnt;
}
signed main() {
  cin >> n;
  dfs("a");
  long long t = bcount(n);
  for (long long i = 0; i < t; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
