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