#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<string> v;
  for (int i = (1 << n) - 1; i >= 0; i--) {
    string s = "";
    int y = 0, q = 0;
    char c;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        if (q == 0) {
          c = char(y + int('a'));
          y = y + 1;
          s = s + c;
          q = q + 1;
        } else
          s = s + c;
      } else {
        char g = char(y + int('a'));
        s = s + g;
        y = y + 1;
      }
    }
    v.insert(s);
  }
  for (auto i = v.begin(); i != v.end(); i++) cout << *i << "\n";
}
