#include <bits/stdc++.h>
using namespace std;
int vx[] = {0, 0, -1, 1};
int vy[] = {1, -1, 0, 0};
int dx[] = {1, 0, -1, 1, -1, 1, 0, -1};
int dy[] = {1, 1, 1, 0, 0, -1, -1, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
const long long mod = 1e9 + 7;
const int INF = INT_MAX / 2;
const int N_MAX = 300010;
int main() {
  int n;
  cin >> n;
  vector<string> s;
  s.push_back("a");
  for (int t = 0; t < int(n - 1); t++) {
    vector<string> s_temp;
    for (int i = 0; i < int(s.size()); i++) {
      for (int j = 0; j < int(min(i + 2, n)); j++) {
        vector<bool> type = vector<bool>(11, false);
        int cnt = 0;
        char c_temp;
        string str;
        c_temp = 'a' + j;
        str = s[i] + c_temp;
        for (int k = 0; k < int(str.size()); k++) {
          if (!type[str[k] - 'a']) {
            cnt++;
            type[str[k] - 'a'] = true;
          }
        }
        int max_id = 0;
        for (int k = 0; k < int(11); k++)
          if (type[k]) max_id = max(k, max_id);
        if (max_id <= cnt) {
          s_temp.push_back(s[i] + c_temp);
        }
      }
    }
    s = s_temp;
  }
  for (int i = 0; i < int(s.size()); i++) cout << s[i] << endl;
  return 0;
}
