#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e9;
const long long MOD = (long long)1e9 + 7;
vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
int main() {
  int N;
  cin >> N;
  vector<char> cha = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'};
  vector<string> s;
  s.push_back("a");
  long long A = 0;
  for (int i = 1; i < N; i++) {
    long long x = s.size();
    for (int j = A; j < x; j++) {
      long long y = 0;
      for (int k = 0; k < s[j].size() + y + 1; k++) {
        s.push_back(s[j] + cha[k]);
      }
      y++;
    }
    A += x;
  }
  for (long long i = 0; i < s.size(); i++) cout << s[i] << endl;
}
