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