#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int N;
set<string> st;
void rec(char c, int sum, int pre, string S) {
  if (S.length() == N) {
    if (N > 2) {
      if (S[1] != 'a') {
        st.insert(S);
        return;
      }
    }
    do {
      if (S[0] == 'a') st.insert(S);
    } while (next_permutation(S.begin(), S.end()));
  } else {
    for (int i = pre; i >= 1; i--) {
      if (i + sum > N) continue;
      string tmp = S;
      for (int j = 0; j < (i); j++) tmp += c;
      rec(c + 1, sum + i, i, tmp);
    }
  }
}
int main() {
  cin >> N;
  for (int i = N; i >= 1; i--) {
    rec('a', 0, N, "");
  }
  for (string s : st) {
    cout << s << endl;
  }
  return 0;
}
