#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N;
void dfs(string s, int mx) {
  if (s.length() == N) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= 'a' + mx; c++) {
    string res = s + c;
    dfs(res, mx + 1);
  }
}
int main() {
  cin >> N;
  dfs("a", 1);
  return 0;
}
