#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const int MOD = 1000000007;
const int MOD_MAX = 200000;
using ll = long long;
using vi = vector<int>;
using vi2 = vector<vi>;
using vi3 = vector<vi2>;
using vll = vector<ll>;
using vll2 = vector<vll>;
using vll3 = vector<vll2>;
using vd = vector<double>;
using vd2 = vector<vd>;
using vd3 = vector<vd2>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
using vpi = vector<pi>;
using vpll = vector<pll>;
bool feq(float x, float y) { return abs(x - y) <= eps; }
bool deq(double x, double y) { return abs(x - y) <= eps; }
int ceillog2(ll x) { return int(ceil(log2(x))); }
int floorlog2(ll x) { return int(floor(log2(x))); }
template <class T>
T reversed(T container) {
  reverse(container.begin(), container.end());
  return container;
}
template <class T>
T sort(T container) {
  sort(container.begin(), container.end());
  return container;
}
ll gcd(ll m, ll n) {
  if (n == 0)
    return m;
  else
    return gcd(n, m % n);
}
ll lcm(ll m, ll n) { return m * n / gcd(m, n); }
void rec(int n, string s) {
  if (n == s.size()) {
    cout << s << endl;
    return;
  }
  for (int i = (int)(int)s.back(); i < (int)97 + n; i++) {
    string t = s + (char)i;
    rec(n, t);
  }
}
int main() {
  int n;
  cin >> n;
  rec(n, "a");
}
