#include <bits/stdc++.h>
using namespace std;
void genStrings(string s, vector<string> &list, int N) {
  if (s.length() == N) {
    list.push_back(s);
    return;
  }
  int n = s.length();
  int prevchar = s[n - 1] - 'a';
  for (int i = 0; i <= prevchar + 1; ++i) {
    genStrings(s + ((char)('a' + i)), list, N);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long N;
  cin >> N;
  if (N == 1) {
    cout << "a\n";
    return 0;
  }
  vector<string> list;
  string s = "a";
  genStrings(s, list, N);
  sort(list.begin(), list.end());
  for (int i = 0; i < list.size(); ++i) {
    cout << list[i] << "\n";
  }
  return 0;
}
