#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
const int MOD = 1e9 + 7;
const long long INF = 1e+14;
const double PI = 3.14159265349;
void dfs(string cur, long long m, long long rest) {
  if (rest == 0) {
    cout << cur << "\n";
  } else {
    for (long long(i) = 0; (i) < (m); (i)++) {
      char next = 'a' + i;
      dfs(cur + next, i + 2, rest - 1);
    }
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  dfs("", 1, N);
  return 0;
}
