#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> aaa[11][11] = {};
  aaa[1][1] = {"a"};
  string xx[10] = {"a",      "ab",      "abc",      "abcd",      "abcde",
                   "abcdef", "abcdefg", "abcdefgh", "abcdefghi", "abcdefghij"};
  string xxx[10] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
  for (int i = 1; i < N; i++) {
    for (int j = 1; j <= i; j++) {
      for (auto x : aaa[i][j]) {
        for (auto y : xx[j - 1]) {
          aaa[i + 1][j].push_back(x + y);
        }
        aaa[i + 1][j + 1].push_back(x + xxx[j]);
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    for (auto x : aaa[N][i]) {
      cout << x << endl;
    }
  }
}
