#include <bits/stdc++.h>
using namespace std;
vector<bool> prime(90000002, true);
void Sieve() {
  for (int p = 2; p * p <= 90000001; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= 90000001; i += p) prime[i] = false;
    }
  }
}
void generate(vector<string> &ans, vector<char> &v, long long len,
              string &cur) {
  if (len == 0) {
    ans.push_back(cur);
    return;
  }
  for (long long i = 0; i < v.size(); i++) {
    cur.push_back(v[i]);
    generate(ans, v, len - 1, cur);
    cur.pop_back();
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long tests = 1;
  while (tests--) {
    long long n, i;
    string s;
    cin >> n;
    vector<char> v;
    for (i = 0; i < n; i++) v.push_back(97 + i);
    vector<string> ans;
    if (n == 1) {
      cout << "a";
      return 0;
    }
    generate(ans, v, n - 1, s);
    for (auto x : ans) cout << "a" << x << "\n";
  }
  return 0;
}
