#include <bits/stdc++.h>
using namespace std;
int static fast = []() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  return 0;
}();
int use_char(string s) {
  vector<int> used(15, 0);
  for (char c : s) used[c - 'a'] = 1;
  return accumulate(used.begin(), used.end(), 0);
}
int main() {
  int n;
  cin >> n;
  map<int, vector<string>> dp;
  dp[1] = {"a"};
  for (int i = 2; i <= n; i++) {
    map<int, vector<string>> new_dp;
    for (auto p : dp) {
      int len = p.first;
      for (string s : p.second) {
        for (int i = 0; i <= len; i++) {
          string s2 = s;
          s2 += ('a' + i);
          new_dp[use_char(s2)].push_back(s2);
        }
      }
    }
    dp = new_dp;
  }
  for (auto p : dp) {
    for (string s : p.second) {
      cout << s << endl;
    }
  }
  return 0;
}
