#include <bits/stdc++.h>
using namespace std;
int N;
void Equivalance(char *a, char mx, int i) {
  if (i == N) {
    cout << a << endl;
    return;
  }
  for (char ch = 'a'; ch <= mx; ch++) {
    a[i] = ch;
    if (ch == mx) {
      Equivalance(a, mx + 1, i + 1);
    } else {
      Equivalance(a, mx, i + 1);
    }
  }
}
int main() {
  cin >> N;
  char a[100];
  Equivalance(a, 'a', 0);
  return 0;
}
