#include <bits/stdc++.h>
using namespace std;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
i32 n;
void dfs(string ans = "", i32 d = 0) {
  if (d == n) {
    cout << ans << endl;
    return;
  }
  for (char c = 'a'; c <= 'a' + d; c++) {
    dfs(ans + c, d + 1);
  }
}
int main() {
  cin >> n;
  dfs();
}
