#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
const int MOD = 1000000007;
const int nmax = 401234;
int n, nw, nx = 1;
vector<string> v2[2];
int main() {
  scanf("%d", &n);
  v2[nw].push_back("");
  for (int i = 0; i < n; ++i) {
    for (int k = 0; k <= i; ++k) {
      char tmp = 'a' + k;
      for (int j = 0; j < v2[nw].size(); ++j) {
        v2[nx].push_back(v2[nw][j] + tmp);
      }
    }
    nx = nw;
    nw = 1 - nw;
    v2[nx].clear();
  }
  for (int j = 0; j < v2[nw].size(); ++j) {
    char tmp = 'a';
    int flg = 0;
    for (int i = 0; i < n; ++i) {
      if (v2[nw][j][i] - tmp > 1) {
        flg = 1;
        break;
      } else if (v2[nw][j][i] - tmp > 0)
        tmp = v2[nw][j][i];
    }
    if (flg == 0) v2[nx].push_back(v2[nw][j]);
  }
  for (int j = 0; j < v2[nx].size(); ++j) cout << v2[nx][j] << endl;
  return 0;
}
