#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, l;
  cin >> n;
  int count[10];
  string dp[n + 1][100000];
  dp[1][0] = "a";
  count[1] = 1;
  for (i = 2; i <= n; i++) {
    int num = 0;
    for (j = 1; j < i; j++) {
      for (k = 0; k < count[j]; k++) {
        for (l = 0; l < count[i - j]; l++) {
          dp[i][num] = dp[j][k] + dp[i - j][l];
          num++;
        }
      }
    }
    if (i == 2) dp[i][num] = "ab";
    if (i == 3) dp[i][num] = "abc";
    if (i == 4) dp[i][num] = "abcd";
    if (i == 5) dp[i][num] = "abcde";
    if (i == 6) dp[i][num] = "abcdef";
    if (i == 7) dp[i][num] = "abcdefg";
    if (i == 8) dp[i][num] = "abcdefgh";
    if (i == 9) dp[i][num] = "abcdefghi";
    if (i == 10) dp[i][num] = "abcdefghij";
    num++;
    count[i] = num;
  }
  for (i = 0; i < count[n]; i++) cout << dp[n][i] << endl;
}
