#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
using vvi = vector<vi>;
using ll = long long int;
const int MOD = 1000 * 1000 * 1000 + 7;
void bt(int ul, int idx, int n, string& sol, string& ultsol) {
  if (idx == n) {
    cout << sol << '\n';
    assert(ultsol == "" || sol > ultsol);
    ultsol = sol;
    return;
  }
  if (idx == 0) {
    for (int i = 0; i <= ul; ++i) {
      sol.push_back('a' + i);
      bt(i, idx + 1, n, sol, ultsol);
      sol.pop_back();
    }
  } else {
    for (int i = 0; i <= ul + 1; ++i) {
      sol.push_back('a' + i);
      bt(i, idx + 1, n, sol, ultsol);
      sol.pop_back();
    }
  }
}
bool res() {
  int n;
  cin >> n;
  if (!cin) return false;
  string str = "";
  string ultsol = "";
  bt(0, 0, n, str, ultsol);
  return true;
}
int main() {
  while (res()) {
  }
  return 0;
}
