#include <bits/stdc++.h>
using namespace std;
char alpha[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
int N;
int MEMO[10][10];
void search(string cur, int variation, int num_a) {
  if (cur.length() == N) {
    if (MEMO[variation][num_a] == 1) return;
    cout << cur << endl;
    MEMO[variation][num_a] = 1;
    return;
  }
  for (int c = 0; c < cur.length() + 1; c++) {
    int next_var = variation;
    int next_num_a = num_a;
    if (c == 0) next_num_a++;
    if (c == cur.length() && variation == cur.length()) {
      next_var++;
    }
    search(cur + alpha[c], next_var, next_num_a);
  }
}
int main() {
  cin >> N;
  search("", 0, 0);
  return 0;
}
