#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
template <typename T>
T beki(T x, long long n) {
  T res = 1;
  while (n > 0) {
    if (n & 1) res *= x;
    x = x * x;
    n >>= 1;
  }
  return res;
}
int main() {
  int N;
  cin >> N;
  if (N == 1) {
    cout << 'a' << endl;
    return 0;
  }
  queue<string> a;
  a.push("aa");
  a.push("ab");
  bool flag = true;
  while (1) {
    string s = a.front();
    int ssize = s.size();
    if (ssize == N) break;
    a.pop();
    char last = s.at(ssize - 1);
    for (int i = 'a'; i <= last + 1; i++) {
      char c = i;
      string ss = s + c;
      a.push(ss);
    }
  }
  vector<string> s(0);
  while (a.size()) {
    s.push_back(a.front());
    a.pop();
  }
  sort((s).begin(), (s).end());
  for (auto x : s) cout << x << endl;
}
