#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<set<string>> ret(11);
  ret[0].insert("a");
  for (int i = 1; i < n; ++i) {
    vector<set<string>> temp(11);
    for (int j = 0; j < 10; ++j) {
      for (auto &s : ret[j]) {
        for (int k = 0; k <= j; ++k) {
          temp[j].insert(s + string(1, 'a' + k));
        }
        temp[j + 1].insert(s + string(1, 'a' + j + 1));
      }
    }
    swap(ret, temp);
    for (auto &r : temp) {
      r.clear();
    }
  }
  for (int i = 0; i < 10; ++i) {
    for (auto &r : ret[i]) {
      cout << r << "\n";
    }
  }
  return 0;
}
