#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<string> v;
  string p = "";
  for (int i = 0; i < n; ++i) {
    p += "a";
  }
  v.push_back(p);
  string s = "abcdefghijklmnopqrstuvwxyz";
  for (int i = n - 1; i > 0; --i) {
    int x = (int)v.size();
    for (int j = 0; j < x; ++j) {
      string b = v[j];
      for (int k = 1; k <= i; ++k) {
        b[i] = s[k];
        v.push_back(b);
      }
    }
  }
  sort(v.begin(), v.end());
  vector<string> res;
  for (int i = (int)v.size() - 1; i >= 0; --i) {
    map<char, int> m;
    vector<int> a;
    int cnt = 1;
    for (int k = 0; k < n; ++k) {
      if (!m[v[i][k]]) {
        a.push_back(cnt);
        m[v[i][k]] = cnt;
        cnt++;
      } else {
        a.push_back(m[v[i][k]]);
      }
    }
    bool ch = 1;
    for (int j = 0; j < i; ++j) {
      map<char, int> m1;
      vector<int> b;
      int cnt1 = 1;
      for (int e = 0; e < n; ++e) {
        if (!m1[v[j][e]]) {
          b.push_back(cnt1);
          m1[v[j][e]] = cnt1;
          cnt1++;
        } else {
          b.push_back(m1[v[j][e]]);
        }
      }
      if (a == b) {
        ch = 0;
        break;
      }
    }
    if (ch) {
      res.push_back(v[i]);
    }
  }
  for (int i = (int)res.size() - 1; i >= 0; --i) {
    cout << res[i] << endl;
  }
}
