#include <bits/stdc++.h>
using namespace std;
void GetAnsDisplay(string s) {
  int tmp = (int)(s.at(s.size() - 1) - 'a');
  for (int i = 0; i <= tmp + 1; i++) {
    string tmp_s = s + (char)(i + 'a');
    cout << tmp_s << endl;
  }
}
void GetAns(string s, int n) {
  n--;
  bool lastFlag = false;
  if (n == 1) lastFlag = true;
  int tmp = (int)(s.at(s.size() - 1) - 'a');
  if (lastFlag) {
    for (int i = 0; i <= tmp + 1; i++) {
      string tmp_s = s + (char)(i + 'a');
      cout << tmp_s << endl;
    }
  } else {
    for (int i = 0; i <= tmp + 1; i++) {
      string tmp_s = s + (char)(i + 'a');
      GetAns(tmp_s, n);
    }
  }
}
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "a" << endl;
    return 0;
  }
  GetAns("a", n);
  return 0;
}
