#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> aaa[11][11][2] = {};
  aaa[1][1][0] = {"a"};
  aaa[1][1][1] = {"a"};
  string xx[10] = {"a",      "ab",      "abc",      "abcd",      "abcde",
                   "abcdef", "abcdefg", "abcdefgh", "abcdefghi", "abcdefghij"};
  char 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][0]) {
        for (auto y : xx[j]) {
          if (y == xxx[j]) {
            aaa[i + 1][j + 1][0].push_back(x + y);
            aaa[i + 1][j][1].push_back(x + y);
          } else {
            aaa[i + 1][j][0].push_back(x + y);
            aaa[i + 1][j][1].push_back(x + y);
          }
        }
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    for (auto x : aaa[N][i][1]) {
      cout << x << endl;
    }
  }
}
