#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int n;
set<string> st;
void dfs(int len, int prev, string s) {
  if (len == n) {
    st.insert(s);
    return;
  }
  if (prev > 0) dfs(len + 1, prev - 1, s + (char)('a' + prev - 1));
  dfs(len + 1, prev, s + (char)('a' + prev));
  if (prev < n) dfs(len + 1, prev + 1, s + (char)('a' + prev + 1));
}
int main() {
  cin >> n;
  dfs(1, 0, "a");
  for (auto x : st) cout << x << endl;
}
