#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int n;
vector<string> dp[20];
int main() {
  cin >> n;
  dp[1].push_back("a");
  for (int i = 1; i <= n - 1; i++) {
    for (int j = 0; j < dp[i].size(); j++) {
      dp[i + 1].push_back(dp[i][j] + dp[i][j][dp[i][j].size() - 1]);
      dp[i + 1].push_back(dp[i][j] + (char)(dp[i][j][dp[i][j].size() - 1] + 1));
    }
  }
  for (int i = 0; i < dp[n].size(); i++) cout << dp[n][i] << endl;
  return 0;
}
