#include <bits/stdc++.h>
using namespace std;
const int MD = (int)1e9 + 7;
void dbg() { cerr << "\n"; }
template <class T, class... T2>
void dbg(const T& fst, const T2&... rst) {
  cerr << fst << ": ";
  dbg(rst...);
}
template <class T, class T2>
void amax(T& a, T2 b) {
  if (a < b) a = b;
}
int ym, xmx;
vector<int> ct;
void rcf(int idx) {
  if (idx == ym) {
    for (int(i) = 0; (i) < (ym); (i)++)
      if (ct[i] > i) return;
    for (auto x : ct) printf("%c", char(x + 'a'));
    printf("\n");
    return;
  }
  for (int(i) = 0; (i) < (xmx); (i)++) {
    if (idx > 0 && ct[idx - 1] > i) continue;
    ct[idx] = i;
    rcf(idx + 1);
  }
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  ym = n;
  xmx = n;
  ct.assign(n, 0);
  rcf(0);
  return 0;
}
