#include <bits/stdc++.h>
using namespace std;
int N;
void dfs(string str, char next, int length) {
  string newstr = str + next;
  if (length == N) {
    cout << newstr << endl;
  } else {
    for (char c = 'a'; c <= (char)(next + 1); c++) {
      dfs(newstr, c, length + 1);
    }
  }
}
int main() {
  cin >> N;
  dfs("", 'a', 1);
  return 0;
}
