#include <bits/stdc++.h>
using namespace std;
int n;
vector<char> vec = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
vector<string> strvec;
void pushmin(int x, string str) {
  if (str.length() > n - 1) {
    strvec.push_back(str);
  } else {
    for (int i = 0; i < x + 2; i++) {
      string s = str;
      s.push_back(vec[i]);
      pushmin(i, s);
    }
  }
}
int main() {
  cin >> n;
  pushmin(-1, "");
  for (vector<string>::iterator itr = strvec.begin(); itr != strvec.end();
       itr++) {
    cout << *itr << endl;
  }
  return 0;
}
