#include <bits/stdc++.h>
using namespace std;
const static string ASCII("abcdefghijklmnopqrstuvwxyz");
int N;
void rec(string s, char mx) {
  if (s.size() == N)
    printf("%s\n", s.c_str());
  else {
    for (char c = 'a'; c <= mx; c++) {
      rec(s + c, c == mx ? (char)(mx + 1) : c);
    }
  }
}
int main() {
  cin >> N;
  rec("", 'a');
}
