#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int N;
void f(int c, string s) {
  if (s.size() == N) {
    cout << s << endl;
  }
  for (int i = 0; i < c; i++) {
    s += 'a' + i;
    f(c, s);
  }
  s = 'a' + c;
  f(c + 1, s);
}
int main() {
  cin >> N;
  f(0, "a");
}
