#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr int mo = 1e9 + 7;
constexpr int inf = 1 << 30;
constexpr ll infl = 1ll << 60;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<string> s;
  s.push_back("a");
  if (n != 1) {
    for (int i = 1; i < n; ++i) {
      vector<string> t;
      for (auto a : s) {
        for (int j = 0; j <= i; ++j) {
          t.push_back(a + char('a' + j));
        }
      }
      swap(s, t);
    }
  }
  for (auto a : s) {
    cout << a << endl;
  }
  return 0;
}
