#include <bits/stdc++.h>
using namespace std;
const int N = 11;
int a[N];
int n;
void dfs(int u) {
  int first = -1;
  for (int i = 0; i < n; ++i) {
    if (a[i] == 0) {
      first = i;
      break;
    }
  }
  if (first == -1) {
    for (int i = 0; i < n; ++i) {
      putchar(a[i] + 'a' - 1);
    }
    putchar('\n');
    return;
  }
  a[first] = u;
  if (first == n - 1) {
    for (int i = 0; i < n; ++i) {
      putchar(a[i] + 'a' - 1);
    }
    putchar('\n');
    return;
  }
  for (int i = first + 1; i < n; ++i) {
    if (a[i] == 0) {
      a[i] = u;
      dfs(u + 1);
      a[i] = 0;
      dfs(u + 1);
    }
  }
  a[first] = 0;
}
int main(int argc, char const *argv[]) {
  cin >> n;
  dfs(1);
  return 0;
}
