#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int inf = 1e9;
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int n;
set<string> S;
void rec(int i, string s) {
  if (s.size() == n) {
    S.insert(s);
    return;
  }
  for (int j = 0; j < i + 2; j++) {
    s += ('a' + j);
    rec(j, s);
    s.erase(s.size() - 1);
  }
}
int main() {
  string s = "a";
  cin >> n;
  rec(0, s);
  for (auto p : S) {
    cout << p << "\n";
  }
}
