#include <bits/stdc++.h>
using namespace std;
char abc[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
vector<string> s;
int n;
void solve(int cnt, string now) {
  cnt++;
  for (int i = 0; i < (cnt); i++) {
    if (cnt == n) {
      s.push_back(now + abc[i]);
    } else {
      solve(cnt, now + abc[i]);
    }
  }
  return;
}
int main() {
  cin >> n;
  solve(0, "");
  sort(s.begin(), s.end());
  for (int i = 0; i < (s.size()); i++) {
    cout << s[i] << endl;
  }
}
