#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
const ll MOD = 1000000007;
int n;
void dfs(string s, int len) {
  if (len == n) {
    std::cout << (s) << "\n";
    return;
  }
  for (char c = 'a'; c <= s[len - 1] + 1; c++) {
    dfs(s + string(1, ((char)c)), len + 1);
  }
}
void solve() {
  cin >> n;
  dfs("a", 1);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  cout << fixed << setprecision(12);
  solve();
}
