#include <bits/stdc++.h>
long long mod = 1e9 + 7;
const long long INF = 1LL << 60;
using namespace std;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (int)(n); i++) {
    vector<int> arr;
    for (int j = 0; j < (int)(i); j++) {
      arr.push_back(j + 1);
    }
    for (int j = 0; j < (int)(n - i); j++) {
      arr.push_back(0);
    }
    sort(arr.begin(), arr.end());
    vector<vector<int>> memo;
    do {
      bool flag = true;
      vector<int> tmp;
      for (int k = 0; k < (int)(arr.size()); k++) {
        if (k != 0) {
          if (arr[k] != arr[k - 1]) {
            tmp.push_back(k);
          }
        }
      }
      for (int k = 0; k < (int)(memo.size()); k++) {
        if (memo[k].size() == tmp.size() &&
            equal(memo[k].cbegin(), memo[k].cend(), tmp.cbegin()))
          flag = false;
      }
      if (flag) {
        vector<int> new_tmp;
        vector<bool> s_memo(arr.size());
        int s_iter = -1;
        for (int k = 0; k < (int)(arr.size()); k++) {
          if (!s_memo[arr[k]]) {
            s_iter++;
          }
          s_memo[arr[k]] = true;
          cout << char('a' + s_iter);
          if (k != 0) {
            if (arr[k] != arr[k - 1]) {
              new_tmp.push_back(k);
            }
          }
        }
        cout << endl;
        memo.push_back(new_tmp);
      }
    } while (next_permutation(arr.begin(), arr.end()));
  }
  return 0;
}
