#include <bits/stdc++.h>
using namespace std;
const int w = 5e5 + 5;
const long long mod = 1e9 + 7;
int a[15];
int n;
void dfs(int pos, int x, int flag) {
  if (pos == n + 1) {
    for (int i = 1; i <= n; i++) {
      char c = a[i] - 1 + 'a';
      printf("%c", c);
    }
    printf("\n");
    return;
  }
  a[pos] = x;
  dfs(pos + 1, x, 1);
  if (flag) {
    a[pos] = x + 1;
    dfs(pos + 1, x + 1, 0);
  }
}
int main() {
  int i, j;
  cin >> n;
  dfs(1, 1, 0);
  return 0;
}
