#include <bits/stdc++.h>
using namespace std;
constexpr long long int linf = numeric_limits<long long int>::max() - 5;
constexpr int inf = numeric_limits<int>::max() - 5;
constexpr long long int mod = 1000000007;
void dfs(int n, string s = "", char maxc = 'a') {
  if (s.size() == n) {
    cout << s << endl;
  } else {
    for (auto c = 'a'; c <= maxc; c++) {
      dfs(n, s + c, (c == maxc ? c + 1 : c));
    }
  }
}
int main() {
  int n;
  cin >> n;
  dfs(n);
  return 0;
}
