#include <bits/stdc++.h>
using namespace std;
set<string> st;
void f(int rest, string s, char mx) {
  if (rest == 0) {
    cout << s << endl;
  } else {
    for (char c = 'a'; c <= mx; c++) {
      f(rest - 1, s + c, max(c, char(mx + 1)));
    }
  }
}
int main() {
  int n;
  cin >> n;
  string s = "";
  f(n, s, 'a');
  for (auto e : st) {
    cout << e << endl;
  }
}
