#include <bits/stdc++.h>
using namespace std;
const int NR = 2e5 + 5;
ifstream in("viitor.in");
ofstream out("viitor.out");
vector<char> st;
vector<vector<char> > sol;
int n;
void rec(int poz, int high) {
  int i, maxim = 0;
  if (poz == n + 1) {
    sol.push_back(st);
    return;
  }
  for (i = 0; i <= min(high, 25); ++i) {
    st.push_back('a' + i);
    maxim = max(maxim, i);
    rec(poz + 1, maxim + 1);
    st.pop_back();
  }
}
int main() {
  cin >> n;
  if (n == 1) return cout << 'a', 0;
  st.push_back('a');
  rec(2, 1);
  sort(sol.begin(), sol.end());
  for (int i = 0; i < sol.size(); ++i, cout << '\n')
    for (int j = 0; j < sol[i].size(); ++j) cout << sol[i][j];
  return 0;
}
