#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1000000009;
long long i;
vector<string> a = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"};
int main() {
  int N;
  cin >> N;
  vector<pair<string, int>> ans;
  for (long long j = 0; j < N; j++) {
    if (j == 0)
      ans.push_back(pair<string, int>("a", 0));
    else {
      int size = ans.size();
      for (long long k = 0; k < size; k++) {
        if (ans.at(k).second + 1 == j) {
          for (int x = 0; x < j; x++) {
            ans.push_back(pair<string, int>(ans.at(k).first + a.at(x), j - 1));
          }
          ans.push_back(pair<string, int>(ans.at(k).first + a.at(j), j));
        } else {
          for (int y = 0; y < ans.at(k).second; y++) {
            ans.push_back(
                pair<string, int>(ans.at(k).first + a.at(y), ans.at(k).second));
          }
          ans.push_back(pair<string, int>(
              ans.at(k).first + a.at(ans.at(k).second), ans.at(k).second + 1));
        }
      }
      ans.erase(ans.begin(), ans.begin() + size);
    }
  }
  vector<string> realans;
  for (int w = 0; w < ans.size(); w++) realans.push_back(ans.at(w).first);
  sort(realans.begin(), realans.end());
  for (string h : realans) cout << h << endl;
}
