#include <bits/stdc++.h>
using namespace std;
ifstream in("in.txt");
vector<int> a;
int n;
void hah(int j) {
  if (j == n) {
    for (auto it : a) {
      cout << char('a' + it);
    }
    cout << "\n";
    return;
  }
  for (int i = 0; i <= j; ++i) {
    a.push_back(i);
    hah(j + 1);
    a.pop_back();
  }
}
int main() {
  cin >> n;
  hah(0);
  return 0;
}
