#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  for (long long i = 0, i_len = (n - 1); i < i_len; i++) {
    string s = "";
    for (long long j = 0, j_len = (n - i); j < j_len; j++) s += 'a';
    for (long long j = 0, j_len = (i); j < j_len; j++) s += '{';
    do {
      string tmp = s;
      char c = 'b';
      for (long long j = 0, j_len = (n); j < j_len; j++) {
        if (tmp[j] == '{') {
          tmp[j] = c;
          c++;
        }
      }
      cout << tmp << endl;
    } while (next_permutation((s).begin(), (s).end()));
  }
  string s = "";
  for (long long i = 0, i_len = (n); i < i_len; i++) s += (char)('a' + i);
  cout << s << endl;
  return 0;
}
