#include <bits/stdc++.h>
using namespace std;
void disp(string &s, int N) {
  if (s.length() == N) {
    cout << s << endl;
  } else {
    for (char c = 'a'; c <= s.back() + 1; c++) {
      s.push_back(c);
      disp(s, N);
      s.pop_back();
    }
  }
}
int main() {
  int N;
  cin >> N;
  string S = "a";
  disp(S, N);
  return 0;
}
