#include <bits/stdc++.h>
using namespace std;
int n, i, ans[16], sel[255];
bool valid(int pos) {
  if (sel[ans[pos]] || (!sel[ans[pos]] && ans[pos] - 1 == ans[pos - 1]))
    return 1;
  return 0;
}
void bkt(int k) {
  if (k == n - 1) {
    for (int it = 0; it < n; ++it) cout << char(ans[it] + 'a');
    cout << '\n';
    return;
  }
  for (int it = 0; it < 20; ++it) {
    ans[k + 1] = it;
    if (valid(k + 1)) {
      ++sel[it];
      bkt(k + 1);
      ans[k + 1] = 0;
      --sel[it];
    }
  }
}
int main() {
  cin >> n;
  for (i = 0; i < n; ++i) ans[i] = 0;
  sel[0] = 1;
  bkt(0);
  return 0;
}
