#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmin(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, const T &b) {
  if (b > a) a = b;
}
const int inf = 1e9 + 10;
const int maxn = 15;
vector<string> ans;
int n;
void dfs(int pos, char c, string s) {
  if (pos == n) {
    ans.push_back(s);
    return;
  }
  for (char now = max('a', char(c - 1)); now <= min('z', char(c + 1)); now++) {
    dfs(pos + 1, now, s + now);
  }
}
int main() {
  cin >> n;
  dfs(1, 'a', "a");
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
