#include <bits/stdc++.h>
using namespace std;
long long gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long x, long long y) { return (x * y) / gcd(x, y); }
vector<string> sall;
void dfs(string s, int n) {
  if (n == -1) return;
  char c = s[s.size() - 1];
  string s1 = s + c;
  c++;
  string s2 = s + c;
  dfs(s1, n - 1);
  dfs(s2, n - 1);
  if (n == 0) sall.push_back(s);
  return;
}
int main() {
  int n;
  cin >> n;
  string s = "a";
  dfs(s, n - 1);
  for (int i = 0; i < (int)(sall.size()); i++) {
    cout << sall[i] << endl;
  }
}
