#include <bits/stdc++.h>
using namespace std;
int64_t N;
void dfs(string s) {
  if (s.size() == N) {
    cout << s << endl;
    return;
  }
  char last = s[s.size() - 1];
  int cint = last - 'a';
  for (int i = 0; i <= cint + 1; i++) {
    char sb = 'a' + i;
    string next_s = s + sb;
    dfs(next_s);
  }
}
int main() {
  cin >> N;
  string S = "a";
  dfs(S);
}
