#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n;
  vector<string> s;
  string buf(n, 'a');
  s.push_back(buf);
  for (int(i) = (1); (i) < (n); (i)++) {
    for (int(j) = (i); (j) < (n); (j)++) {
      buf[j]++;
      s.push_back(buf);
    }
  }
  sort(s.begin(), s.end());
  for (int(i) = (0); (i) < (s.size()); (i)++) cout << s[i] << endl;
}
