#include <bits/stdc++.h>
template <class T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
using ll = long long;
using P = pair<int, int>;
vector<string> ans;
int n;
vector<char> al;
void dfs(string s = "a", int cnt = 1) {
  if (cnt == n) {
    ans.push_back(s);
    return;
  }
  for (int i = 0; i <= (s[s.size() - 1] - 'a') + 1; i++) {
    dfs(s + al[i], cnt + 1);
  }
}
int main(void) {
  cin >> n;
  for (char c = 'a'; c <= 'z'; c++) al.push_back(c);
  dfs();
  sort(ans.begin(), ans.end());
  for (int(i) = 0; (i) < (ans.size()); (i)++) cout << ans[i] << endl;
  return 0;
}
