#include <bits/stdc++.h>
using namespace std;
set<string> a;
int n;
void dfs(string s, int b) {
  if (s.size() == n) {
    a.insert(s);
    return;
  }
  int t = s[s.size() - 1] - b + 1;
  for (int i = b; i <= t; i++) {
    dfs(s + char(i), (b == t) ? t + 1 : t);
  }
}
int main() {
  cin >> n;
  string s = "a";
  int b = 97;
  dfs(s, b);
  for (auto value : a) cout << value << endl;
}
