#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[n];
  for (int i = 0; i < (int)(n); ++i) {
    s[i] = 'a';
  }
  while (true) {
    for (int z = 0; z < (int)(n); ++z) {
      cout << s[z];
    }
    cout << endl;
    int k = n - 1;
    while (k > 0) {
      if (s[k - 1] < s[k]) {
        s[k] = 'a';
        k--;
      } else {
        s[k] += 1;
        break;
      }
    }
    if (k == 0) {
      break;
    }
  }
  return 0;
}
