#include <bits/stdc++.h>
using namespace std;
void solve(string str, int n);
int main() {
  int n;
  cin >> n;
  solve("a", n);
}
void solve(string str, int n) {
  if (str.size() == n)
    cout << str << endl;
  else {
    if (*str.rbegin() != 'a') solve(str + 'a', n);
    solve(str + (char)(*str.rbegin()), n);
    solve(str + (char)(*str.rbegin() + 1), n);
  }
}
