#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;
int n;
void dfs(string s, char prev) {
  if (s.size() >= n) {
    cout << s << ln;
    return;
  }
  for (char c = 'a'; c <= prev + 1; c++) {
    dfs(s + c, c);
  }
  return;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cin >> n;
  dfs("a", 'a');
  return 0;
}
