#include <bits/stdc++.h>
using namespace std;
int n;
void solve(int n, int now, string ans) {
  if (now == n + 1) {
    cout << ans << endl;
    return;
  }
  for (int i = max(ans[ans.size() - 1] - 'a' - 1, 1);
       i <= min(ans[ans.size() - 1] - 'a' + 2, now); i++) {
    string s = "a";
    s[0] = s[0] + i - 1;
    solve(n, now + 1, ans + s);
  }
}
int main() {
  cin >> n;
  solve(n, 2, "a");
  return 0;
}
