#include <bits/stdc++.h>
using namespace std;
int n;
string s = "abcdefghijklmnopqrstuvwxyz";
int ch(char a) { return a - 'a'; }
vector<string> ve[11];
int main() {
  cin >> n;
  ve[0].push_back("a");
  for (int i = 0; i < 10; i++) {
    for (auto j : ve[i]) {
      for (int x = 0; x <= ch(j[j.size() - 1]) + 1; x++) {
        ve[i + 1].push_back(j + s[x]);
      }
    }
  }
  sort(ve[n - 1].begin(), ve[n - 1].end());
  for (auto u : ve[n - 1]) cout << u << "\n";
}
