#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];
  for (char ci = 'a'; ci < last + 2; ci++) {
    string next_s = s + ci;
    solve(next_s);
  }
}
