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