#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class T>
using V = vector<T>;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) { return a / GCD(a, b) * b; }
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int ddx[8] = {-1, 0, 1, 0, 1, 1, -1, -1};
int ddy[8] = {0, -1, 0, 1, 1, -1, 1, -1};
char dir[4] = {'u', 'l', 'd', 'r'};
long long int cmp(pair<long long int, long long int> a,
                  pair<long long int, long long int> b) {
  if (a.second != b.second)
    return a.second < b.second;
  else
    return a.first < b.first;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) s += 'a';
  int nowmax[11];
  memset(nowmax, 0, sizeof(nowmax));
  if (n == 1) {
    cout << s << endl;
    return 0;
  }
  for (int i = 0; i < 2; i++) {
    s[1] = 'a' + i;
    if (n == 2) {
      cout << s << endl;
      continue;
    }
    for (int j = 0; j <= i + 1; j++) {
      s[2] = 'a' + j;
      nowmax[2] = (nowmax[2] > j ? nowmax[2] : j);
      if (n == 3) {
        cout << s << endl;
        continue;
      }
      int xj = nowmax[2];
      nowmax[3] = (nowmax[3] > nowmax[2] ? nowmax[3] : nowmax[2]);
      for (int a = 0; a <= (xj > j + 1 ? xj : j + 1); a++) {
        s[3] = 'a' + a;
        nowmax[3] = (nowmax[3] > a ? nowmax[3] : a);
        if (n == 4) {
          cout << s << endl;
          continue;
        }
        int xa = nowmax[3];
        nowmax[4] = (nowmax[4] > nowmax[3] ? nowmax[4] : nowmax[3]);
        for (int b = 0; b <= (xa > a + 1 ? xa : a + 1); b++) {
          s[4] = 'a' + b;
          nowmax[4] = (nowmax[4] > b ? nowmax[4] : b);
          if (n == 5) {
            cout << s << endl;
            continue;
          }
          int xb = nowmax[4];
          nowmax[5] = (nowmax[5] > nowmax[4] ? nowmax[5] : nowmax[4]);
          for (int c = 0; c <= (xb > b + 1 ? xb : b + 1); c++) {
            s[5] = 'a' + c;
            nowmax[5] = (nowmax[5] > c ? nowmax[5] : c);
            if (n == 6) {
              cout << s << endl;
              continue;
            }
            int xc = nowmax[5];
            nowmax[6] = (nowmax[6] > nowmax[5] ? nowmax[6] : nowmax[5]);
            for (int d = 0; d <= (xc > c + 1 ? xc : c + 1); d++) {
              s[6] = 'a' + d;
              nowmax[6] = (nowmax[6] > d ? nowmax[6] : d);
              if (n == 7) {
                cout << s << endl;
                continue;
              }
              int xd = nowmax[6];
              nowmax[7] = (nowmax[7] > nowmax[6] ? nowmax[7] : nowmax[6]);
              for (int e = 0; e <= (xd > d + 1 ? xd : d + 1); e++) {
                s[7] = 'a' + e;
                nowmax[7] = (nowmax[7] > e ? nowmax[7] : e);
                if (n == 8) {
                  cout << s << endl;
                  continue;
                }
                int xe = nowmax[7];
                nowmax[8] = (nowmax[8] > nowmax[7] ? nowmax[8] : nowmax[7]);
                for (int f = 0; f <= (xe > e + 1 ? xe : e + 1); f++) {
                  s[8] = 'a' + f;
                  nowmax[8] = (nowmax[8] > f ? nowmax[8] : f);
                  if (n == 9) {
                    cout << s << endl;
                    continue;
                  }
                  int xf = nowmax[8];
                  for (int g = 0; g <= (xf > f + 1 ? xf : f + 1); g++) {
                    s[9] = 'a' + g;
                    cout << s << endl;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return 0;
}
