#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T1, class T2>
ostream& operator<<(ostream& s, pair<T1, T2> P) {
  return s << '<' << P.first << ", " << P.second << '>';
}
template <class T>
ostream& operator<<(ostream& s, vector<T> P) {
  for (long long i = 0; i < P.size(); ++i) {
    if (i > 0) {
      s << " ";
    }
    s << P[i];
  }
  return s;
}
template <class T>
ostream& operator<<(ostream& s, vector<vector<T> > P) {
  for (long long i = 0; i < P.size(); ++i) {
    s << endl << P[i];
  }
  return s << endl;
}
template <class T>
ostream& operator<<(ostream& s, set<T> P) {
  for (__typeof__((P).begin()) it = (P).begin(); it != (P).end(); ++it) {
    s << "<" << *it << "> ";
  }
  return s << endl;
}
template <class T1, class T2>
ostream& operator<<(ostream& s, map<T1, T2> P) {
  for (__typeof__((P).begin()) it = (P).begin(); it != (P).end(); ++it) {
    s << "<" << it->first << "->" << it->second << "> ";
  }
  return s << endl;
}
template <class T>
void show(vector<T> v) {
  for (long long i = 0; i < v.size(); i++) {
    cerr << v[i] << " ";
  }
  cerr << "\n";
}
long long n;
string s;
void dfs(char c, long long depth) {
  if (depth == n) {
    cout << s << endl;
    return;
  }
  char tmp;
  for (long long i = 0; i <= c - 'a' + 1; i++) {
    tmp = s[depth];
    s[depth] = (char)('a' + i);
    dfs(s[depth], depth + 1);
    s[depth] = tmp;
  }
}
signed main() {
  cin >> n;
  if (n == 1) {
    cout << 'a' << endl;
    return 0;
  }
  string u;
  for (long long i = 0; i < n; i++) {
    s.push_back('a');
    u.push_back('a');
  }
  cout << s << endl;
  for (long long i = 0; i < n - 1; i++) {
    s[n - 1 - i] = 'b';
    dfs('b', n - i);
    s = u.substr(0, n);
  }
  return 0;
}
