#include <bits/stdc++.h>
using namespace std;
string a = "abcdefghij";
int flag[10] = {0};
string s;
int check() {
  for (int i = 0; i < s.size(); i++) {
    for (int j = 0; j < 10; j++)
      if (s[i] == a[j]) flag[j] = 1;
  }
  int r = 0;
  for (int i = 0; i < 10; i++)
    if (flag[i] != 0) r++;
  return r;
}
void pri(int n, int sum) {
  int move = 0;
  if (n != 1) {
    for (int i = 0; i < sum + 1; i++) {
      s += a[i];
      pri(n - 1, check());
      s = s.substr(0, s.size() - 1);
    }
  } else {
    for (int i = 0; i < sum + 1; i++) cout << s + a[i] << endl;
    return;
  }
  return;
}
int main() {
  int n;
  cin >> n;
  pri(n, 0);
  return 0;
}
