#include <bits/stdc++.h>
using namespace std;
vector<string> tmp;
void out_char(int num, string s, char c) {
  if (s.length() >= num) {
    tmp.push_back(s);
    return;
  }
  char next_c = c++;
  string c_now = {c};
  string c_next = {next_c};
  out_char(num, s + c_now, c);
  out_char(num, s + c_next, next_c);
}
int main() {
  int n;
  cin >> n;
  out_char(n, "a", 'a');
  for (int i = tmp.size() - 1; i >= 0; i--) {
    cout << tmp[i] << endl;
  }
}
