#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = long long unsigned;
using P = pair<int, int>;
const int INF = 1001001;
int n;
int dfs(string s, int i) {
  if (s.size() == n) {
    cout << s << endl;
    return 0;
  }
  for (char c = 'a'; c < 'a' + i + 1; c++) {
    string t = s + c;
    dfs(t, max(i + 1, c - 'a' + 1));
  }
}
int main() {
  cin >> n;
  dfs("", 0);
}
