#include <bits/stdc++.h>
using namespace std;
int n;
void str(string s = "") {
  if (s.length() == n) {
    cout << s << "\n";
    return;
  }
  for (int i = 0; i <= s.back() - 'a' + 1; i++) {
    string now = s;
    now.push_back(i + 'a');
    str(now);
  }
}
int main() {
  cin >> n;
  str("a");
}
