#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
void dfs(int N, int i, int count, string s, vector<string> &S);
int main() {
  int N;
  cin >> N;
  vector<string> S;
  string s(N, 'a');
  if (N == 1) {
    cout << 'a' << endl;
    return 0;
  }
  int count = 0;
  dfs(N, 0, count, s, S);
  sort(S.begin(), S.end());
  S.erase(S.begin() + 1);
  int size = S.size();
  for (int i = 0; i < (int)(size); i++) {
    cout << S.at(i) << endl;
  }
}
void dfs(int N, int i, int count, string s, vector<string> &S) {
  if (i == 0) {
    s.at(i) = 'a';
    count++;
    dfs(N, i + 1, count, s, S);
  } else if (i == N) {
    S.push_back(s);
    return;
  } else {
    for (int j = 0; j < (int)(count + 1); j++) {
      s.at(i) = 'a' + j;
      if (j == 0) {
        dfs(N, i + 1, count, s, S);
      } else {
        dfs(N, i + 1, count + 1, s, S);
      }
    }
  }
}
