#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int n;
void dfs(int len, int prev, string s) {
  if (len == n) {
    cout << s << endl;
    return;
  }
  dfs(len + 1, prev, s + (char)('a' + prev));
  dfs(len + 1, prev + 1, s + (char)('a' + prev + 1));
}
int main() {
  cin >> n;
  dfs(1, 0, "a");
}
