#include <bits/stdc++.h>
using namespace std;
string s = "a";
int n;
void dfs(int step) {
  if (step == n) {
    cout << s << endl;
    return;
  }
  string t = s;
  s = s + s[step - 1];
  char i;
  for (i = 'a'; i <= s[step - 1] + 1; i++) {
    s = t + i;
    dfs(step + 1);
  }
  s = t;
}
int main() {
  int i, j;
  cin >> n;
  dfs(1);
  return 0;
}
