#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<string> s;
void make_str(string str, int n) {
  for (int i = 0; i <= str.length(); ++i) {
    string str1 = str;
    str1 += 'a' + i;
    if (str1.length() < n)
      make_str(str1, n);
    else
      s.push_back(str1);
  }
}
int main() {
  int n;
  cin >> n;
  make_str("", n);
  sort(s.begin(), s.end());
  for (int i = 0; i < s.size(); ++i) {
    cout << s[i] << endl;
  }
}
