#include <bits/stdc++.h>
using namespace std;
long long Abs(long long x, long long y) {
  if (x >= y)
    return x - y;
  else
    return y - x;
}
set<string> w;
map<int, char> m;
int n;
void dfs(string u, int x, int now, int use, int use_max) {
  if (now == n) {
    w.insert(u);
    return;
  }
  if ((x >> (n - 1 - now)) & 1)
    dfs(u, x, now + 1, use, use_max);
  else {
    if (use == use_max - 1) {
      u[now] = m[use];
      dfs(u, x, now + 1, use, use_max);
    } else {
      u[now] = m[use];
      dfs(u, x, now + 1, use, use_max);
      u[now] = m[use + 1];
      dfs(u, x, now + 1, use + 1, use_max);
    }
  }
}
int main(void) {
  for (char x = 'a'; x <= 'z'; x++) m[x - 'a'] = x;
  cin >> n;
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  }
  string x = "";
  for (int i = 0; i < n; i++) x.push_back('a');
  for (int i = 0; i < (1 << n); i++) {
    for (int use = 1; use <= n; use++) {
      string u = x;
      dfs(u, i, 1, 0, use);
    }
  }
  for (auto itr = w.begin(); itr != w.end(); ++itr) {
    cout << (*itr) << endl;
  }
  return 0;
}
