#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long double EPS = 1e-8;
void makeStr(const int N, string str, vector<string>& answer) {
  if (str.size() == N) {
    answer.emplace_back(str);
    return;
  }
  for (long long i = (0); i < (str.back() - 'a' + 2); i++) {
    makeStr(N, str + (char)('a' + i), answer);
  }
}
void solve(long long N) {
  vector<string> answer;
  makeStr(N, "a", answer);
  sort((answer).begin(), (answer).end());
  for (long long i = (0); i < (answer.size()); i++) {
    cout << answer[i] << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}
