#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = (long long int)1e15;
vector<string> v;
long long int N;
void dfs(vector<long long int> u) {
  if (u.size() == N - 1) {
    string s = "a";
    char c = 'b';
    for (long long int(i) = (0); (i) < (u.size()); ++(i)) {
      if (s.size() > u[i]) {
        s.push_back(s[u[i]]);
      } else {
        s.push_back(c);
        c = (char)(c + 1);
      }
    }
    v.push_back(s);
    return;
  }
  for (long long int i = 0; i <= u.size() + 1; ++i) {
    u.push_back(i);
    dfs(u);
    u.pop_back();
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  string s = "";
  for (long long int(i) = (0); (i) < (N); ++(i)) {
    s.push_back('a');
  }
  v.clear();
  vector<long long int> u;
  dfs(u);
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  for (long long int(i) = (0); (i) < (v.size()); ++(i)) {
    cout << v[i] << endl;
  }
  return 0;
}
