#include <bits/stdc++.h>
using namespace std;
int N;
void dfs(vector<string> &vec, string s) {
  if (s.size() == N) {
    vec.push_back(s);
    return;
  }
  char last = s[s.size() - 1];
  dfs(vec, s + last);
  last = static_cast<int>(last) + 1;
  dfs(vec, s + last);
  if (last != 'a' && last != 'b') last = static_cast<int>(last) - 2;
  dfs(vec, s + last);
}
int main() {
  cin >> N;
  vector<string> vec;
  string s = "a";
  dfs(vec, s);
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  for (int i = 0; i < vec.size(); i++) cout << vec[i] << endl;
}
