#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int N;
string s;
set<string> a;
void dfs(string now, int j) {
  if (now.size() >= N) {
    a.insert(now);
    return;
  }
  for (int i = 97; i < (j + 2); i++) {
    string now_ = now + (char)i;
    dfs(now_, i);
  }
}
int main() {
  cin >> N;
  dfs("a", 97);
  for (auto s_ : a) {
    cout << s_ << "\n";
    ;
  }
}
