#include <bits/stdc++.h>
using namespace std;
void printAllIsomorphic(int n, int scope, vector<char> oneString,
                        char possibilities) {
  if (scope == n) {
    for (const char c : oneString) {
      cout << c;
    }
    cout << endl;
    return;
  }
  for (char c = 'a'; c <= possibilities; c++) {
    oneString.push_back(c);
    printAllIsomorphic(n, scope + 1, oneString, possibilities + 1);
    oneString.pop_back();
  }
  return;
}
int main() {
  int n;
  cin >> n;
  int scope = 0;
  vector<char> oneString;
  char possibilities = 'a';
  printAllIsomorphic(n, scope, oneString, possibilities);
  return 0;
}
