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