#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "{";
  for (size_t i = 0; i < v.size(); i++)
    os << v[i] << (i + 1 == v.size() ? "" : ", ");
  os << "}";
  return os;
}
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  return os << "{" << p.first << ", " << p.second << "}";
}
vector<string> ans;
int N;
void dfs(string s, int M) {
  if (s.size() == N) {
    ans.push_back(s);
    return;
  }
  for (int i = 0; i < M; i++) {
    string t = s + string(1, 'a' + i);
    dfs(t, M);
  }
}
void myfill(string s) {
  int M = s.size();
  dfs(s, M);
}
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    string s;
    for (int j = 0; j < i; j++) s.push_back('a' + j);
    myfill(s);
  }
  for (auto x : ans) cout << x << endl;
  return 0;
}
