#include <bits/stdc++.h>
using namespace std;
const int N = 11;
int a[N];
int n;
void dfs(int u) {
  vector<int> em;
  for (int i = 0; i < n; ++i) {
    if (a[i] == 0) {
      em.push_back(i);
    }
  }
  if (em.size() == 0) {
    for (int i = 0; i < n; ++i) {
      putchar(a[i] + 'a' - 1);
    }
    putchar('\n');
    return;
  }
  int first = em[0];
  a[first] = u;
  if (em.size() == 1) {
    for (int i = 0; i < n; ++i) {
      putchar(a[i] + 'a' - 1);
    }
    putchar('\n');
    a[first] = 0;
    return;
  }
  int m = em.size() - 1;
  for (int i = (1 << m) - 1; i >= 0; --i) {
    for (int j = 0; j < m; ++j) {
      if ((i >> j) & 1) {
        a[em[m - j]] = u;
      }
    }
    dfs(u + 1);
    for (int j = 0; j < m; ++j) {
      if ((i >> j) & 1) {
        a[em[m - j]] = 0;
      }
    }
  }
  a[first] = 0;
}
int main(int argc, char const *argv[]) {
  cin >> n;
  dfs(1);
  return 0;
}
