#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 201001;
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long int n;
  cin >> n;
  vector<string> vec;
  vec.push_back("a");
  long long int let = 0;
  for (long long int d = 1; d < n; d++) {
    vector<string> vec1;
    for (long long int i = 0; i < vec.size(); i++) {
      vec[i].push_back('a');
      for (long long int j = 0; j <= let + 1 && j < 26; j++) {
        vec[i].back() = 'a' + j;
        vec1.push_back(vec[i]);
      }
    }
    vec.swap(vec1);
  }
  for (string s : vec) {
    cout << s << "\n";
  }
}
