#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
const int INFTY = 2147483647;
int n, p;
char C[11];
int X[11];
void solve(int x, int p) {
  for (int i = 0; i < (X[x - 1] + 2); ++i) {
    X[x] = i;
    if (x == n - 1) {
      for (int j = 0; j < (n); ++j) cout << C[X[j]];
      cout << endl;
    } else
      solve(x + 1, X[i]);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < (10); ++i) C[i] = 'a' + i;
  X[0] = 0;
  if (n == 1)
    cout << 'a' << endl;
  else
    solve(1, 0);
}
