#include <bits/stdc++.h>
using namespace std;
string ans[10][10050];
int main() {
  int n, len = 1;
  cin >> n;
  ans[1][1] = "a";
  for (int i = 1; i < n; i++) {
    int cnt = 0;
    for (int j = 1; j <= len; j++) {
      for (int k = 0; k <= ans[i][j][i - 1] - 'a' + 1; k++) {
        ans[i + 1][++cnt] = ans[i][j];
        char tmp = 'a' + k;
        ans[i + 1][cnt] += tmp;
      }
    }
    len = cnt;
  }
  for (int i = 1; i <= len; i++) cout << ans[n][i] << endl;
}
