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