#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T>
void view(const std::vector<T>& v) {
  for (const auto& e : v) {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T> >& vv) {
  for (const auto& v : vv) {
    view(v);
  }
}
template <typename T>
void view(T e) {
  std::cout << e << std::endl;
}
template <typename T>
void viewarr(T arr[], int n) {
  for (int i = 0; i < n; ++i) std::cout << arr[i] << " ";
  std::cout << std::endl;
}
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
ll qp(ll a, ll b) {
  ll ans = 1;
  do {
    if (b & 1) ans = 1ll * ans * a;
    a = 1ll * a * a;
  } while (b >>= 1);
  return ans;
}
ll qp(ll a, ll b, ll mo) {
  ll ans = 1;
  do {
    if (b & 1) ans = 1ll * ans * a % mo;
    a = 1ll * a * a % mo;
  } while (b >>= 1);
  return ans;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const ll INFL = 1e18;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5;
struct str {
  string s;
  int last;
  str(string s) : s(s) {
    for (int i = (int)(0); i < (int)(((int)(s).size())); ++i)
      chmax(last, s[i] - 'a');
  }
};
int main() {
  int N;
  cin >> N;
  queue<str> que;
  que.push(str("a"));
  while (1) {
    str s = que.front();
    if (((int)(s.s).size()) >= N) break;
    que.pop();
    for (int i = (int)(0); i < (int)(min(s.last + 2, 26)); ++i) {
      string nw = s.s;
      nw += (char)(i + 'a');
      que.push(str(nw));
    }
  }
  vector<string> v;
  while (!que.empty()) {
    str s = que.front();
    que.pop();
    v.push_back(s.s);
  }
  sort((v).begin(), (v).end());
  for (auto e : v) {
    cout << e << endl;
  }
  return 0;
}
