#include <bits/stdc++.h>
using namespace std;
template <class T>
using pql = priority_queue<T, vector<T>>;
template <class T>
using pq = priority_queue<T, vector<T>, greater<T>>;
void ansYes(bool flag) {
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
void ansYES(bool flag) {
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
struct node {
  int64_t to;
  int64_t length;
};
vector<int64_t> divisor(int64_t n) {
  vector<int64_t> ret;
  for (int64_t i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  return (ret);
}
int dx8[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx[4] = {0, -1, 0, 1};
int dy[4] = {-1, 0, 1, 0};
struct datas {
  int64_t max;
  int64_t size;
};
class ContainChecker {
 protected:
  int64_t minx, miny, maxx, maxy;

 public:
  ContainChecker(int64_t minx, int64_t miny, int64_t maxx, int64_t maxy)
      : minx(minx), miny(miny), maxx(maxx), maxy(maxy){};
  bool in(int64_t x, int64_t y) {
    return (minx <= x && miny <= y && x <= maxx && y <= maxy);
  }
};
int64_t n;
vector<string> que;
void dfs(string s, char k) {
  if (s.size() == n) {
    que.push_back(s);
    return;
  }
  for (int i = 0; i <= k; i++) {
    dfs(s + (char)('a' + i), i + 1);
  }
}
int main(void) {
  cin >> n;
  dfs("a", 1);
  for (auto z : que) {
    cout << z << endl;
  }
}
