#include <bits/stdc++.h>
const int inf = (1 << 30);
const int mod = 1000000007;
using ll = long long;
using namespace std;
int n;
void dfs(string s, int used, int cnt) {
  if (cnt == n) {
    cout << s << endl;
    return;
  }
  for (int i = 0; i <= used; ++i) {
    dfs(s + (char)('a' + i), max(used, i + 1), cnt + 1);
  }
}
int main() {
  cin >> n;
  dfs("a", 1, 1);
}
