#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<string> A, B;
  A.push_back("a");
  for (int i = 1; i < N; i++) {
    int Q = A.size();
    for (int j = 0; j < Q; j++) {
      string X = A[j];
      int CNT_ALP[26] = {0};
      int cnt = 0;
      for (int k = 0; k < A[j].length(); k++) {
        if (CNT_ALP[A[j][k] - 'a'] == 0) {
          CNT_ALP[A[j][k] - 'a']++;
          cnt++;
        }
      }
      char z = 'a';
      for (int k = 0; k < cnt + 1; k++) {
        auto Z = std::string() + z;
        B.push_back(X + Z);
        z++;
      }
    }
    A.clear();
    for (int k = 0; k < B.size(); k++) {
      A.push_back(B[k]);
    }
    B.clear();
  }
  for (int i = 0; i < A.size(); i++) {
    cout << A[i] << endl;
  }
}
