#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MOD = 1000000007;
const long double EPS = 1e-10;
const long double PI = 3.141592653589793;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const pair<long long, long long> fd[] = {make_pair(1, 0), make_pair(-1, 0),
                                         make_pair(0, 1), make_pair(0, -1)};
long long n;
vector<string> ans;
void rec(string s, long long v) {
  if (s.length() == n) {
    ans.push_back(s);
    return;
  }
  for (long long i = (0); i < (v + 1); i++) {
    rec(s + (char)((long long)'a' + i), i + 1);
  }
}
signed main() {
  cin >> n;
  rec("a", 1);
  for (long long i = (0); i < (ans.size()); i++) cout << ans[i] << endl;
}
