#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int n;
int main() {
  cin >> n;
  vector<vector<string>> ans(10);
  ans.at(0).push_back("a");
  if (n == 1) {
    cout << ans.at(n - 1).at(0) << endl;
  } else {
    for (int i = 1; i < n; ++i) {
      int anslen = ans.at(i - 1).size();
      for (int j = 0; j < anslen; ++j) {
        string ansc = ans.at(i - 1).at(j);
        int ansclen = ansc.length();
        int alpmax = (int)(ansc.at(ansclen - 1)) - 97;
        for (int k = 0; k <= alpmax + 1; ++k) {
          string anscc = ansc + (char)(97 + k);
          ans.at(i).push_back(anscc);
        }
      }
    }
    int alen = ans.at(n - 1).size();
    for (int i = 0; i < alen; ++i) {
      cout << ans.at(n - 1).at(i) << endl;
    }
  }
}
