#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
const long long MOD = (int)1e9 + 7;
const long long INF = MOD * MOD;
const long long powll = 1LL << 1;
int n;
void f(string s) {
  if (s.size() == n)
    cout << s << "\n";
  else {
    for (int i = 0; i < s.size() + 1; i++) {
      if (s == "" || i - (s[s.size() - 1] - 'a') <= 1) {
        string t = s + (char)('a' + i);
        f(t);
      }
    }
  }
}
int main() {
  cin >> n;
  f("");
}
