#include <bits/stdc++.h>
using namespace std;
int n;
void f(vector<char> &s, char can_use) {
  int size = s.size();
  if (size == n) {
    for (char c : s) {
      cout << c;
    }
    cout << endl;
    return;
  }
  for (int i = 'a'; i <= can_use; i++) {
    s.push_back(i);
    f(s, i + 1);
    s.pop_back();
  }
}
int main() {
  cin >> n;
  vector<char> s;
  f(s, 'a');
}
