#include <bits/stdc++.h>
using namespace std;
constexpr double PI = 3.1415926535897932;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<string> ans;
  for (int bit = 0; bit < (1 << n); ++bit) {
    set<int> pos;
    for (int i = 0; i < n; ++i) {
      if ((bit >> i) & 1) pos.insert(i);
    }
    string s;
    char c = 'a';
    char c2 = 'z';
    for (int i = 0; i < n; ++i) {
      if (pos.find(i) == pos.end()) {
        s += c++;
      } else {
        if (c2 == 'z') {
          c2 = c++;
          s += c2;
        } else {
          s += c2;
        }
      }
    }
    ans.push_back(s);
  }
  sort(ans.begin(), ans.end());
  ans.erase(unique(ans.begin(), ans.end()), ans.end());
  int sz = ans.size();
  for (int i = 0; i < sz; ++i) cout << ans[i] << "\n";
}
