#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using LLP = pair<long long, long long>;
constexpr int IINF = (1 << 30) - 1;
constexpr long long LLINF = 1LL << 61;
constexpr double EPS = 1e-10;
constexpr int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
constexpr int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1},
              dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
vector<string> ans;
void solve(int k, const int n, string s) {
  if (k == n) {
    ans.push_back(s);
    return;
  }
  if (k == 0) {
    solve(1, n, "a");
  } else {
    for (char c = 'a'; c <= s.back() + 1; c++) {
      solve(k + 1, n, s + c);
    }
  }
  return;
}
template <typename T>
bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, T b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  solve(0, n, "");
  sort((ans).begin(), (ans).end());
  for (auto s : ans) {
    cout << s << '\n';
  }
  cout << flush;
  return 0;
}
