#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = 1e9;
const double EPS = 1e-9;
const double PI = acos(-1.0);
const int DX[4] = {1, 0, -1, 0};
const int DY[4] = {0, 1, 0, -1};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int N;
vector<pair<char, int>> s;
vector<char> vc;
void rec(char c, int n) {
  if (n == N) {
    for (int i = (0); i < (N); i++) {
      cout << vc[i];
    }
    cout << endl;
    return;
  }
  for (char i = 'a'; i <= c + 1; i++) {
    vc.push_back(i);
    rec(i, n + 1);
    vc.pop_back();
  }
}
int main() {
  cin >> N;
  vc.push_back('a');
  rec('a', 1);
  return 0;
}
