#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
map<long long, char> moji;
bool jisyojunn(string s) {
  set<char> toujou;
  long long a = 0;
  bool ans = true;
  for (int i = 0; i < s.size(); i++) {
    if (toujou.find(s[i]) == toujou.end()) {
      if (s[i] == moji[a]) {
        a++;
        toujou.insert(s[i]);
        continue;
      } else {
        ans = false;
        break;
      }
    } else
      continue;
  }
  return ans;
}
int main() {
  long long n;
  cin >> n;
  moji[0] = 'a';
  moji[1] = 'b';
  moji[2] = 'c';
  moji[3] = 'd';
  moji[4] = 'e';
  moji[5] = 'f';
  moji[6] = 'g';
  moji[7] = 'h';
  moji[8] = 'i';
  moji[9] = 'j';
  vector<string> vec;
  for (long long a = 0; a <= n; a++) {
    for (long long b = 0; b <= n - a; b++) {
      for (long long c = 0; c <= n - a - b; c++) {
        for (long long d = 0; d <= n - a - b - c; d++) {
          for (long long e = 0; e <= n - a - b - c - d; e++) {
            for (long long f = 0; f <= n - a - b - c - d - e; f++) {
              for (long long g = 0; g <= n - a - b - c - d - e - f; g++) {
                for (long long h = 0; h <= n - a - b - c - d - e - f - g; h++) {
                  for (long long i = 0; i <= n - a - b - c - d - e - f - g - h;
                       i++) {
                    long long j = n - a - b - c - d - e - f - g - h - i;
                    string s = "";
                    for (long long k = 0; k < a; k++) s += moji[0];
                    for (long long k = 0; k < b; k++) s += moji[1];
                    for (long long k = 0; k < c; k++) s += moji[2];
                    for (long long k = 0; k < d; k++) s += moji[3];
                    for (long long k = 0; k < e; k++) s += moji[4];
                    for (long long k = 0; k < f; k++) s += moji[5];
                    for (long long k = 0; k < g; k++) s += moji[6];
                    for (long long k = 0; k < h; k++) s += moji[7];
                    for (long long k = 0; k < i; k++) s += moji[8];
                    for (long long k = 0; k < j; k++) s += moji[9];
                    do {
                      vec.push_back(s);
                    } while (next_permutation(s.begin(), s.end()));
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  sort(vec.begin(), vec.end());
  set<string> ans1;
  for (long long i = 0; i < vec.size(); i++) {
    if (jisyojunn(vec[i])) ans1.insert(vec[i]);
  }
  vector<string> ans;
  for (auto itr = ans1.begin(); itr != ans1.end(); ++itr) {
    ans.push_back(*itr);
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
}
