#include <bits/stdc++.h>
using namespace std;
int N;
void adding(string s, int n, vector<char> l) {
  if (n == N) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i < n + 1; i++) {
    adding(s + l[i], n + 1, l);
  }
}
int main() {
  cin >> N;
  vector<string> SS;
  string S = "";
  vector<char> C = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
  adding("", 0, C);
  return 0;
}
