#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  function<void(char, int, string)> solve;
  solve = [&](char ch, int dep, string s) {
    if (dep == 0) {
      cout << s << '\n';
      return;
    }
    for (register int chr = ('a'); chr <= (ch); ++chr) {
      solve(chr, dep - 1, s + (char)chr);
    }
    solve(ch + 1, dep - 1, s + (char)(ch + 1));
  };
  solve('a', n - 1, "a");
  return 0;
}
