#include <bits/stdc++.h>
using namespace std;
long long get() {
  char c = getchar();
  long long x = 0LL;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    x *= 10LL;
    x += (c - '0');
    c = getchar();
  }
  return x;
}
int n;
void dfs(string s) {
  if (s.size() == n) {
    cout << s << "\n";
    return;
  }
  for (int i = 0; i < s.size() + 1; i++) {
    string t = s;
    t += (char)('a' + i);
    dfs(t);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  dfs("a");
  return 0;
}
