#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 10;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
int n;
void dfs(int cur, int st, string s) {
  if (cur == n) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i <= st + 1; i++) {
    char c = 'a' + i;
    dfs(cur + 1, i, s + c);
  }
}
int main() {
  cin >> n;
  dfs(1, 0, "a");
  return 0;
}
