#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int N;
vector<string> res;
void dfs(int idx, int d, string str) {
  if (idx == N - 1) {
    res.push_back(str);
  } else {
    for (int i = 0; i <= d + 1; ++i) {
      string tmp = str;
      tmp += 'a' + i;
      dfs(idx + 1, i, tmp);
    }
  }
}
int main() {
  cin >> N;
  dfs(0, 0, "a");
  for (int i = 0; i < res.size(); ++i) {
    cout << res[i] << endl;
  }
  return 0;
}
