#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
const double PI = acos(-1.0);
int n;
vector<string> vec;
void dfs(string x) {
  if (x.size() == n) {
    vec.push_back(x);
    return;
  }
  for (int i = 0; i < (int)(x.at(x.size() - 1) - 'a' + 2); i++) {
    dfs(x + char('a' + i));
  }
}
int main() {
  cin >> n;
  dfs("a");
  sort(vec.begin(), vec.end());
  for (int i = 0; i < (int)(vec.size()); i++) {
    cout << vec.at(i) << endl;
  }
}
