#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
ll mod = ll(1e9) + 7;
ll inf = ll(1e18);
template <typename T1, typename T2>
ll ceill(T1 a, T2 b) {
  return (a + b - 1) / b;
}
void ans(bool b, ostream& out = cout) { out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out = cout) { out << (b ? "YES" : "NO") << endl; }
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
  fill((T*)array, (T*)(array + N), val);
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};
int main() {
  int n;
  cin >> n;
  set<string> res;
  function<void(string, int)> dfs = [&](string s, int x) {
    if (x == n) {
      res.insert(s);
      return;
    }
    char c = s.back();
    int stt = int(c - 'a');
    for (int i = stt; i < stt + 2; i++) {
      dfs(s + char('a' + i), x + 1);
    }
  };
  dfs("a", 1);
  for (auto& e : res) {
    cout << e << endl;
  }
}
