#include <bits/stdc++.h>
using namespace std;
int n;
set<string> v;
void dfs(string s, char a) {
  s += a;
  if (s.size() == n) {
    v.insert(s);
    return;
  }
  for (__typeof(s.size() + 1) i = (0) - ((0) > (s.size() + 1));
       i != (s.size() + 1) - ((0) > (s.size() + 1));
       i += 1 - 2 * ((0) > (s.size() + 1))) {
    char c = 97 + i;
    dfs(s, c);
  }
}
int main() {
  cin >> n;
  dfs("", 'a');
  for (auto x : v) cout << x << '\n';
  return 0;
}
