#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<vector<string>> v(11);
  v[0].push_back("");
  for (int i = 1; i <= 10; i++) {
    for (auto x : v[i - 1]) {
      for (int j = 0; j < i; j++) v[i].push_back(x + (char)('a' + j));
    }
  }
  int n;
  cin >> n;
  for (auto x : v[n]) {
    vector<bool> appear(26);
    int last = -1;
    for (int i = 0; i < n; i++) {
      appear[x[i] - 'a'] = true;
      last = max(last, x[i] - 'a');
    }
    bool ok = true;
    for (int i = 0; i <= last; i++) {
      if (!appear[i]) ok = false;
    }
    if (ok) cout << x << "\n";
  }
  return 0;
}
