#include <bits/stdc++.h>
using namespace std;
double pi = 2 * acos(0.0);
int n;
vector<char> ans;
void back_track(int in, char prev) {
  if (in == n) {
    for (int i = 0; i < n; i++) {
      cout << ans[i];
    }
    cout << "\n";
    return;
  }
  for (int i = 0; i <= prev - 'a' + 1; i++) {
    ans[in] = char(i + 'a');
    back_track(in + 1, ans[in]);
  }
}
int main() {
  cin >> n;
  ans.assign(n, 'a');
  back_track(1, 'a');
  return 0;
}
