#include <bits/stdc++.h>
using namespace std;
void dfs(int i, int n, vector<char> &xs) {
  if (i == n) {
    for (auto c : xs) {
      printf("%c", c);
    }
    printf("\n");
    return;
  }
  for (char c = 'a'; c <= xs[i - 1] + 1; ++c) {
    xs[i] = c;
    dfs(i + 1, n, xs);
  }
}
int main() {
  int n;
  cin >> n;
  vector<char> xs(n);
  xs[0] = 'a';
  dfs(1, n, xs);
  return 0;
}
