#include <bits/stdc++.h>
using namespace std;
int n, cnt = 0;
vector<string> x;
void dfs(int i, string s) {
  if (i == n) {
    x.push_back(s);
    return;
  }
  for (int j = 'a'; j <= s.back() + 1; j++) {
    dfs(i + 1, s + char(j));
  }
  return;
}
int main(void) {
  cin >> n;
  string s = "a";
  dfs(1, s);
  sort(x.begin(), x.end());
  for (int(i) = 0; (i) < (x.size()); (i)++) {
    cout << x[i] << endl;
  }
  return 0;
}
