#include <bits/stdc++.h>
using namespace std;
constexpr char cs[] = {'a', 'b'};
void Solve(string str, size_t pos, int N, vector<string>& res) {
  if (pos == N) {
    return;
  }
  Solve(str, pos + 1, N, res);
  str[pos] = 'b';
  res.push_back(str);
  Solve(str, pos + 1, N, res);
}
int main() {
  int N;
  cin >> N;
  string str(N, 'a');
  vector<string> res{str};
  Solve(str, 1, N, res);
  sort(res.begin(), res.end());
  for (const string& s : res) {
    cout << s << endl;
  }
  return 0;
}
