#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF_LL = (long long)1000000007 * 1000000007;
const long long INF_INT = (long long)1000000007;
const double PI = 3.14159265358979323846;
const long long dx[4] = {1, 0, -1, 0};
const long long dy[4] = {0, 1, 0, -1};
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
set<string> s;
long long N;
void dfs(string second, long long len) {
  if (len == N) {
    s.emplace(second);
    return;
  }
  char buf = second[len - 1];
  second.resize(len + 1);
  second[len] = buf + 1;
  dfs(second, len + 1);
  second[len] = buf;
  dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  second[len] = --buf;
  if (buf >= 'a') dfs(second, len + 1);
  return;
}
signed main() {
  cin >> N;
  string second;
  dfs("a", 1);
  for (auto str : s) {
    cout << str << endl;
  }
}
