#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
template <typename T>
void print(const vector<T> &x) {
  int n = x.size();
  for (int i = 0; i < (n); ++i) {
    cout << x[i];
    if (i != n - 1)
      cout << " ";
    else
      cout << endl;
  }
}
template <typename T>
void print(const vector<vector<T>> &x) {
  int n = x.size();
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (x[i].size()); ++j) {
      cout << x[i][j] << " ";
    }
    cout << endl;
  }
}
template <typename T>
void print(const vector<T> &x, int n) {
  for (int i = 0; i < (n); ++i) {
    cout << x[i];
    if (i != n - 1)
      cout << " ";
    else
      cout << endl;
  }
}
template <typename T>
void print(const vector<vector<T>> &x, int n, int m) {
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (m); ++j) {
      cout << x[i][j] << " ";
    }
    cout << endl;
  }
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
void input_init() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
set<vector<int>> c;
int n;
void dfs(vector<int> b) {
  for (int i = 1; i <= n; ++i) {
    vector<int> ret(b);
    ret.push_back(i);
    sort(ret.begin(), ret.end());
    int s = 0;
    for (int i = 0; i < (ret.size()); ++i) s += ret[i];
    if (s == n) {
      c.insert(ret);
      continue;
    } else if (s > n)
      return;
    else
      dfs(ret);
  }
}
int main(int argc, char const *argv[]) {
  cin >> n;
  set<string> ans;
  vector<int> b;
  dfs(b);
  for (int i = 0; i < (n); ++i) {
    bool fin = false;
    for (auto &&e : c) {
      vector<int> a;
      int cnt = 0;
      for (auto &&f : e) {
        for (int j = 0; j < (f); ++j) {
          a.push_back(cnt);
        }
        cnt++;
      }
      bool tmp = true;
      bool one = true;
      do {
        map<int, char> mp;
        string ret;
        ret.resize(n);
        char cnt = 'a';
        for (int l = 0; l < (a.size()); ++l) {
          if (mp.count(a[l]))
            ret[l] = mp[a[l]];
          else {
            ret[l] = cnt;
            mp[a[l]] = cnt;
            cnt++;
          }
        }
        ans.insert(ret);
      } while (next_permutation(a.begin(), a.end()));
    }
  }
  for (auto &&e : ans) cout << e << '\n';
  return 0;
}
