#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const long long MOD = 1e9 + 7;
const long long INF = 1LL << 60;
long long N;
set<string> se;
void saiki(string s) {
  if (((int)(s).size()) == N) {
    se.insert(s);
  } else {
    char c = s[((int)(s).size()) - 1];
    for (char d = 'a'; d <= c + 1; d++) {
      string t = s;
      t.push_back(d);
      saiki(t);
    }
  }
}
int main() {
  cin >> N;
  string s = "a";
  saiki(s);
  for (auto t : se) {
    cout << t << "\n";
  }
  return 0;
}
