#include <bits/stdc++.h>
using namespace std;
string x(string x, int i1, int i2);
int main(void);
__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
int main(void) {
  int N;
  cin >> N;
  string A = "abcdefghijklmnopqrstuvwxyz";
  vector<pair<string, int>> S;
  string s = "";
  pair<string, int> st = make_pair(s, 0);
  S.push_back(st);
  string x = "";
  long long int cnt_f = 0;
  long long int cnt_e = 0;
  x.push_back(A[0]);
  for (int i = 0; i < (int)(N); i++) {
    for (int k = cnt_f; k <= cnt_e; k++) {
      for (int j = 0; j < (int)(x.size()); j++) {
        if (S[k].second < j - 1) break;
        s = S[k].first;
        s.push_back(x[j]);
        st = make_pair(s, j);
        S.push_back(st);
      }
    }
    cnt_f = cnt_e + 1;
    cnt_e = S.size() - 1;
    x.push_back(A[i + 1]);
  }
  for (int i = 0; i < (int)(S.size()); i++) {
    if (i >= cnt_f) cout << S[i].first << endl;
  }
  return 0;
}
