#include <bits/stdc++.h>
using namespace std;
void dfs(int k, int n, string ans, int mx) {
  if (k == n + 1) {
    cout << ans << endl;
    return;
  }
  for (int i = 0; i < mx; i += 1) {
    if (i == mx - 1)
      dfs(k + 1, n, ans + (char)('a' + i), k + 1);
    else
      dfs(k + 1, n, ans + (char)('a' + i), k);
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  char s[11] = "a";
  dfs(1, n, "", 1);
  return 0;
}
