#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007, MOD2 = 998244353;
int N;
vector<string> ans(0);
string a = "";
void p(int i) {
  if (i == N - 1) {
    int A = a.at(N - 2) - 'a' + 2;
    for (int j = 0; j < (A); j++) {
      a.at(i) = 'a' + j;
      ans.push_back(a);
    }
    return;
  }
  int B = a.at(i - 1) - 'a' + 2;
  for (int j = 0; j < (B); j++) {
    a.at(i) = 'a' + j;
    p(i + 1);
  }
  return;
}
int main() {
  cin >> N;
  if (N == 1) {
    cout << "a" << endl;
  } else {
    for (int i = 0; i < (N); i++) {
      a.push_back('a');
    }
    p(1);
  }
  for (int i = 0; i < (ans.size()); i++) {
    cout << ans.at(i) << endl;
  }
}
