#include <bits/stdc++.h>
using namespace std;
vector<string> answer;
void dfs(int remain, const string& current_str) {
  if (remain == 0) {
    answer.push_back(current_str);
    return;
  }
  for (int d = -1; d <= +1; d++) {
    int last = current_str.back() - 'a';
    int next = last + d;
    if (next >= 0) {
      string next_str = current_str + (char)('a' + next);
      dfs(remain - 1, next_str);
    }
  }
}
int main() {
  int N;
  cin >> N;
  dfs(N - 1, "a");
  for (const auto& s : answer) {
    cout << s << endl;
  }
  return 0;
}
