#include <bits/stdc++.h>
using namespace std;
long long next() {
  long long x;
  cin >> x;
  return x;
}
const long long inf = 1e18, mod = 998244353;
const int intf = 2e9, maxn = 3e5;
const double PI = 3.141592653589, eps = 1e-9;
void rec(int id, int n, string &s) {
  if (id == n) {
    cout << s << '\n';
    return;
  }
  for (char c = 'a'; c <= 'a' + id; c++) {
    s += c;
    rec(id + 1, n, s);
    s.pop_back();
  }
}
void solve() {
  int n;
  cin >> n;
  string s = "";
  rec(0, n, s);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  for (int t = 1; t--;) solve();
  return 0;
}
