#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const long long LINF = 1LL << 60;
const long long MOD = (long long)1e9 + 7;
int n;
void dfs(int x = 1, string s = "a") {
  if (x == n) {
    cout << s << endl;
    return;
  }
  for (char i = s[x - 1]; i < 'a' + n; i++) {
    dfs(x + 1, s + i);
  }
}
int main() {
  cin >> n;
  dfs();
  return 0;
}
