#include <bits/stdc++.h>
using namespace std;
const int N = 6000;
vector<char> v[N], b[N];
string s[N][N];
string a[27] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
int main() {
  int n;
  cin >> n;
  s[1][1] = "a";
  int cnt = 1, ans = 0;
  if (n == 1)
    cout << "a" << endl;
  else
    for (int i = 2; i <= n; i++) {
      for (int j = 1; j <= cnt; j++) {
        for (int k = 1; k <= i; k++) s[i][++ans] = s[i - 1][j] + a[k - 1];
      }
      cnt = ans;
      if (i == n) {
        for (int j = 1; j <= ans; j++) cout << s[i][j] << endl;
        break;
      }
      ans = 0;
    }
  return 0;
}
