#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int IINF = 1e9;
const ll INF = 1e18;
const int MOD = 1e9 + 7;
void chmin(ll &a, ll b) {
  if (a > b) {
    a = b;
  }
}
void chmax(ll &a, ll b) {
  if (a < b) {
    a = b;
  }
}
int main() {
  int N;
  cin >> N;
  vector<vector<string>> result =
      vector<vector<string>>(N + 1, vector<string>());
  for (int i = 1; i <= N; i++) {
    if (i == 1) {
      result[i].push_back("a");
    } else {
      for (int j = 1; j <= i; j++) {
        if (j == i) {
          string candidate = "";
          for (int m = 0; m < i; m++) {
            candidate += 'a';
          }
          result[i].push_back(candidate);
        } else {
          int blocklen = (i - j);
          for (int k = 1; k < i - blocklen + 1; k++) {
            vector<char> tmpstr = vector<char>(i, 'a');
            for (string filler : result[blocklen]) {
              for (int l = k; l <= (k + blocklen - 1); l++) {
                tmpstr[l] = filler[l - k] + 1;
              }
              string candidate = "";
              for (int m = 0; m < i; m++) {
                candidate += tmpstr[m];
              }
              result[i].push_back(candidate);
            }
          }
        }
      }
    }
  }
  vector<string> ans;
  for (int i = 0; i < result.size(); i++) {
    for (string candidate : result[i]) {
      ans.push_back(candidate);
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    if (ans[i].size() == N) {
      cout << ans[i] << endl;
    }
  }
}
