#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
  in >> p.first >> p.second;
  return in;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &v) {
  for (auto &x : v) in >> x;
  return in;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const std::pair<T1, T2> &p) {
  out << "[" << p.first << ", " << p.second << "]"
      << "\n";
  return out;
}
template <class T1, class T2>
inline bool chmin(T1 &a, T2 b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T1, class T2>
inline bool chmax(T1 &a, T2 b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
__int128 toLint(const string s) {
  __int128 ret = 0;
  for (int i = 0; i < s.length(); i++)
    if ('0' <= s[i] && s[i] <= '9') ret = 10 * ret + s[i] - '0';
  return ret;
}
ostream &operator<<(ostream &dest, __int128_t value) {
  ostream::sentry s(dest);
  if (s) {
    __uint128_t tmp = value < 0 ? -value : value;
    char buffer[128];
    char *d = std::end(buffer);
    do {
      --d;
      *d = "0123456789"[tmp % 10];
      tmp /= 10;
    } while (tmp != 0);
    if (value < 0) {
      --d;
      *d = '-';
    }
    int len = std::end(buffer) - d;
    if (dest.rdbuf()->sputn(d, len) != len) {
      dest.setstate(ios_base::badbit);
    }
  }
  return dest;
}
istream &operator>>(istream &in, __int128 &d) {
  string s;
  cin >> s;
  __int128 tmp = 0;
  for (int i = 0; i < s.length(); i++)
    if ('0' <= s[i] && s[i] <= '9') tmp = 10 * tmp + s[i] - '0';
  d = tmp;
  return in;
}
void dfs(int d, int N, set<string> &ans, string s) {
  if (d == N) {
    ans.insert(s);
    return;
  }
  if (s.size() == 0) {
    s += 'a';
    dfs(d + 1, N, ans, s);
    return;
  }
  int b = s.back() - 'a';
  for (int i = 0; i <= b + 1; i++) {
    string t = s + (char)('a' + i);
    dfs(d + 1, N, ans, t);
  }
}
int main() {
  int N;
  cin >> N;
  set<string> ans;
  dfs(0, N, ans, "");
  for (auto x : ans) cout << x << endl;
  return 0;
}
