#include <bits/stdc++.h>
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;
}
using namespace std;
using P = pair<int, int>;
using ll = long long;
const ll INF = 1LL << 60;
const double PI = 3.1415926535897932;
const int MOD = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  set<string> ans;
  for (int bit = 1; bit < (1 << n); bit++) {
    string s = "";
    char same;
    bool first_time = true;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (bit & 1 << i) {
        if (first_time) {
          first_time = false;
          same = 'a' + cnt;
          s += same;
          cnt++;
        } else {
          s += same;
        }
      } else {
        s += 'a' + cnt;
        cnt++;
      }
    }
    ans.insert(s);
  }
  for (auto v : ans) {
    cout << v << endl;
  }
  return 0;
}
