#include <bits/stdc++.h>
using namespace std;
void dfs(int k, int n, char *s) {
  char s1[11] = "";
  strcpy(s1, s);
  if (k == n) {
    cout << s1 << endl;
    return;
  }
  for (int i = 0; i < k; i += 1) {
    s1[k] = s[0];
    dfs(k + 1, n, s1);
    s1[k] = s[0] + 1;
    if (s1[k] <= 'z') dfs(k + 1, n, s1);
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  char s[11] = "a";
  dfs(1, n, s);
  return 0;
}
