#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const long long int LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int mod = 1000000007;
void print_word(int x, int n) {
  int tmp = 1;
  for (int i = 0; i < (n - 1); ++i) tmp *= n;
  for (int i = 0; i < (n); ++i) {
    printf("%c", 'a' + x / tmp);
    x -= x / tmp * tmp;
    tmp /= n;
  }
  printf("\n");
}
int main() {
  int n;
  cin >> n;
  stack<string> st;
  st.push("a");
  while (!st.empty()) {
    string s = st.top();
    st.pop();
    if (s.size() == n)
      cout << s << endl;
    else {
      int last = s.size() - 1;
      st.push(s + char(s[last] + 1));
      st.push(s + char(s[last]));
      if (s[last] != 'a') st.push(s + char(s[last] - 1));
    }
  }
  return 0;
}
