#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const int INF = 1e9;
const long long LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int n;
void dfs(string s) {
  if ((int)s.size() == n)
    cout << s << endl;
  else {
    int t = s[(int)s.size() - 1] - 'a' + 1;
    for (int k = 0; k <= t; k++) {
      string ns = s + (char)('a' + k);
      dfs(ns);
    }
  }
}
int main() {
  cin >> n;
  dfs("a");
}
