#include <bits/stdc++.h>
using namespace std;
int N;
void dfs(string& s) {
  if (s.size() == N) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= s[s.size() - 1] + 1; c++) {
    s.push_back(c);
    dfs(s);
    s.pop_back();
  }
}
void solve(long long N_) {
  N = N_;
  string s = "a";
  dfs(s);
}
int main() {
  long long N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}
