#include <bits/stdc++.h>
using ll = long long;
using namespace std;
set<string> st;
int n;
void dfs(int depth, string s) {
  if (depth == n) {
    if (count(s.begin(), s.end(), 'A')) return;
    for (int i = 0; i < n; i++) s[i] += 'a';
    st.insert(s);
    return;
  }
  for (int bit = 0; bit < (1 << n); bit++) {
    bool res = true;
    for (int i = 0; i < n; i++) {
      if ((bit & (1 << i))) {
        if (s[i] != 'A') {
          res = false;
          break;
        }
        if (depth != 0 && i == 0) return;
        if (i != 0) {
          if (s[i - 1] != depth - 1 && s[i - 1] != depth) return;
        }
        s[i] = depth;
      }
    }
    if (res) dfs(depth + 1, s);
  }
}
int main() {
  cin >> n;
  string S(n, 'A');
  dfs(0, S);
  for (auto i : st) cout << i << endl;
}
