#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
vector<string> s;
int N;
void f(string str) {
  if (str.length() == N) {
    s.push_back(str);
  } else {
    char max = str.back();
    for (char c = 'a'; c <= max + 1; ++c) {
      string ss = str;
      ss.push_back(c);
      f(ss);
    }
  }
}
int main() {
  int n;
  cin >> n;
  N = n;
  f("a");
  for (string sss : s) {
    printf(sss.c_str());
    printf("\n");
  }
  return 0;
}
