#include <bits/stdc++.h>
using namespace std;
int n;
int a[10];
void solve(int tmp) {
  if (tmp == n) {
    char c[n];
    for (int i = 0; i < n; i++) {
      c[i] = 'a' + a[i];
      cout << c[i];
    }
    cout << endl;
  } else {
    for (int i = 0; i < n; i++) {
      a[tmp] = i;
      solve(tmp + 1);
    }
  }
}
int main() {
  cin >> n;
  solve(0);
}
