#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int n;
void dfs(string s) {
  if (s.size() > 1 && s[s.size() - 1] - s[s.size() - 2] > 1) return;
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i < n; i++) {
    string next = s;
    next += i + 'a';
    dfs(next);
  }
}
int main() {
  cin >> n;
  dfs("a");
  return 0;
}
