#include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;
long long modexp(long long a, long long b, long long m) {
  long long r = 1;
  a = a % m;
  while (b > 0) {
    if (b & 1) r = (r * a) % m;
    b >> 1;
    a = (a * a) % m;
  }
  return r % m;
}
vector<vector<string>> g(11);
void func(long long n) {
  string s = "";
  for (int i = 0; i < n; i++) {
    char c = 'b' + i;
    s.push_back(c);
  }
  g[n].push_back(s);
  string temp = s;
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = i + 1; j < n; j++) {
      temp[j] = s[i];
      g[n].push_back(temp);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (int i = 1; i < n; i++) func(n - i);
  vector<string> fin;
  vector<string> a(11);
  string s = "";
  for (int i = 0; i < 11; i++) {
    a[i] = s;
    s += 'a';
  }
  set<string> st;
  st.insert(a[n]);
  for (long long i = 1; i <= 10; i++) {
    for (long long j = 1; j <= 10; j++) {
      if (i + j >= n) continue;
      string temp = a[i];
      for (auto x : g[n - i - j]) {
        temp += x;
        temp += a[j];
        st.insert(temp);
        temp = a[i];
      }
    }
  }
  for (long long i = n; i >= 0; i--) {
    string s = "";
    for (int j = 0; j < i; j++) {
      char c = 'a';
      s.push_back(c);
    }
    for (auto x : g[n - i]) {
      string temp = s;
      temp += x;
      st.insert(temp);
    }
  }
  for (auto x : st) cout << x << endl;
  return 0;
}
