#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  std::vector<std::vector<long long> > v;
  for (long long int i = 0; i < (1 << (n - 1)); i++) {
    long long z = i;
    std::vector<long long> tmp;
    while (z) {
      tmp.push_back(z % 2);
      z /= 2;
    }
    long long diff = n - tmp.size();
    for (long long int j = 0; j < diff; j++) tmp.push_back(0);
    reverse((tmp).begin(), (tmp).end());
    v.push_back(tmp);
  }
  sort((v).begin(), (v).end());
  for (auto i : v) {
    for (long long int j = 0; j < i.size(); j++) {
      cout << char('a' + i[j]);
    }
    cout << '\n';
  }
}
