#include <bits/stdc++.h>
using namespace std;
vector<string> cand[10];
vector<int> maxl[10];
int cnt[10];
int main() {
  int N;
  cin >> N;
  cand[1].push_back("a");
  maxl[1].push_back(0);
  char ss[20] = "abcdefghij";
  for (int i = 2; i <= N; i++) {
    for (int j = 0; j < ((int)(cand[i - 1]).size()); j++) {
      string s = cand[i - 1][j];
      int mm = maxl[i - 1][j];
      for (int k = 0; k <= mm + 1; k++) {
        cand[i].push_back(s + ss[k]);
        maxl[i].push_back(max(mm, k));
      }
    }
  }
  for (int k = 0; k < ((int)(cand[N]).size()); k++) {
    cout << cand[N][k] << endl;
  }
  return 0;
}
