#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 6;
const long long MOD = 1e9 + 7;
const long long LLINF = 1LL << 60;
int N;
void dfs(string s, char prev) {
  if (s.size() == N) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= prev + 1; ++c) {
    dfs(s + c, c);
  }
}
int main() {
  cin >> N;
  dfs("a", 'a');
}
