#include <bits/stdc++.h>
using namespace std;
using l = long;
using ll = long long;
using vd = vector<double>;
using vvd = vector<vector<double>>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using pii = vector<pair<int, int>>;
string str = "abcdefghijklmnopqrstuvwxyz";
int N;
vector<char> v;
void f(int cnt) {
  if (cnt == N - 1) {
    for (int i = 0; i < N; ++i) {
      v[cnt] = str[i];
      for (auto idx : v) cout << idx;
      cout << endl;
    }
  } else {
    for (int i = 0; i < N - 1; ++i) {
      v[cnt] = str[i];
      f(cnt + 1);
    }
  }
}
int main() {
  cin >> N;
  v.resize(N);
  f(0);
  return 0;
}
