#include <bits/stdc++.h>
using namespace std;
int N;
void solve(string);
signed main() {
  cin >> N;
  solve("a");
  return 0;
}
void solve(string s) {
  if (s.length() >= N) {
    cout << s << endl;
    return;
  }
  char last = s[s.length() - 1];
  char max = s[0];
  int i;
  for (i = 0; i < s.length() - 1; i++) {
    if (max < s[i]) max = s[i];
  }
  for (char ci = 'a'; ci <= last + 1 || ci <= max; ci++) {
    string next_s = s + ci;
    solve(next_s);
  }
}
