#include <bits/stdc++.h>
using namespace std;
constexpr double PI = 3.1415926535897932;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1e+9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a\n";
    return 0;
  }
  if (n == 2) {
    cout << "aa\n"
         << "ab\n";
    return 0;
  }
  set<string> s;
  for (int i = 0; i < (1 << n); ++i) {
    vector<int> pop;
    for (int d = n - 1; d >= 0; --d) {
      if ((i >> d) & 1) pop.push_back(d);
    }
    int sz = pop.size();
    string str = "";
    int cnt = 1;
    for (int j = 0; j < n; ++j) {
      if ((i >> j) & 1) {
        char ch = 'a' + cnt;
        ++cnt;
        str += ch;
      } else
        str += "a";
    }
    s.insert(str);
  }
  for (auto it : s) cout << it << "\n";
}
