#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;
void dfs(string S, char mx, int &N) {
  if (S.length() == N) {
    cout << S << endl;
    return;
  }
  char mx_dist = 'a';
  for (char c : S) {
    mx = max(mx_dist, c);
  }
  mx++;
  for (char i = 'a'; i <= mx; i++) {
    dfs(S + i, mx, N);
  }
}
int main() {
  int N = 5;
  dfs("a", 'a', N);
  return 0;
}
