#include <bits/stdc++.h>
using namespace std;
constexpr int mod = 1e9 + 7;
constexpr int MAXNe5 = 1e5 + 7;
constexpr int MAXNe6 = 1e6 + 7;
inline long long read() {
  char c = getchar();
  long long flag = 1, ans = 0;
  while (c < '0' || c > '9') {
    if (c == '-') flag = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    ans = ans * 10 + c - '0';
    c = getchar();
  }
  return (ans * flag);
}
vector<string> ans[12];
int main() {
  int n;
  cin >> n;
  ans[1].push_back("a");
  ans[2].push_back("aa");
  ans[2].push_back("ab");
  if (n == 1 || n == 2) {
  } else {
    for (int i = 2; i < n; ++i) {
      for (int j = 0; j != ans[i].size(); ++j) {
        if (j == 0) {
          ans[i + 1].push_back(ans[i][j] + 'a');
          ans[i + 1].push_back(ans[i][j] + 'b');
        } else {
          char ch = 'a';
          for (int k = 0; k <= i; ++k) {
            ans[i + 1].push_back(ans[i][j] + (char)(ch + k));
          }
        }
      }
    }
  }
  for (int i = 0; i != ans[n].size(); ++i) cout << ans[n][i] << endl;
}
