#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("-ffloat-store")
using namespace std;
void read(vector<long long> &v) {
  for (int i = 0; i < v.size(); i++) cin >> v[i];
}
long long n, m, a, b, c, k, temp, x, y;
const int MAXN = 100000 + 11;
vector<string> str;
map<vector<vector<int>>, bool> mp;
void insert(int pos, string &stri, int len) {
  if (stri.size() == len) {
    vector<vector<int>> v(n);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (stri[j] == stri[i]) {
          v[i].push_back(j);
        }
      }
    }
    if (!mp[v]) {
      str.push_back(stri);
      mp[v] = 1;
    }
    return;
  }
  for (char ch = 'a'; ch <= pos + 'a'; ch++) {
    if (stri.size() > 1 && ch > stri.back() + 1) continue;
    stri.push_back(ch);
    insert(pos + 1, stri, len);
    stri.pop_back();
  }
}
void solveforthiscase(const int &test) {
  cin >> n;
  string s = "";
  insert(0, s, n);
  for (auto x : str) {
    cout << x << ' ';
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  for (int i = 1; i <= test; i++) {
    solveforthiscase(i);
  }
}
