#include <bits/stdc++.h>
using namespace std;
using ll = long long;
string nex(string x) {
  x[x.size() - 1]++;
  int i = x.size() - 1;
  while (x[i] > 'b') {
    x[i - 1]++;
    x[i] = 'a';
    i--;
  }
  return x;
}
int numc(string &x, char tar) {
  int cnt = 0;
  for (auto c : x) {
    if (c == tar) cnt++;
  }
  return cnt;
}
void semi(string x) {
  char tar = 'b';
  while (numc(x, tar) > 1) {
    while (numc(x, tar) > 1) {
      for (int i = x.size() - 1; i >= 0; i--) {
        if (x[i] == tar) {
          x[i]++;
          break;
        }
      }
      cout << x << endl;
    }
    tar++;
  }
}
int main() {
  int n;
  cin >> n;
  string tmp = "";
  int cnt = 0;
  while (cnt++ < n) tmp += "a";
  while (tmp[0] == 'a') {
    cout << tmp << endl;
    semi(tmp);
    tmp = nex(tmp);
  }
}
