#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n;
string s = "a";
void dfs(int pos) {
  if (pos == n) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i <= s[pos - 1] - 'a' + 1; ++i) {
    s += char('a' + i);
    dfs(pos + 1);
    s.erase(s.end() - 1);
  }
}
int main() {
  cin >> n;
  dfs(1);
}
