#include <bits/stdc++.h>
using namespace std;
const int N = 9000;
vector<char> v[N];
string s[N][N];
string a[27] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"};
int b[N];
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++) {
        int t = 0;
        for (int h = 0; h < s[i - 1][j].size(); h++) {
          int x = s[i - 1][j][h] - 'a';
          if (b[x]) continue;
          b[x] = 1;
          if (i == 10) {
            cout << s[i - 1][j] + a[x] << endl;
          } else
            s[i][++ans] = s[i - 1][j] + a[x];
          t = max(t, x);
          b[x] = 1;
        }
        if (i == 10)
          cout << s[i - 1][j] + a[t + 1] << endl;
        else
          s[i][++ans] = s[i - 1][j] + a[t + 1];
      }
      cnt = ans;
      if (i == n && i != 10) {
        for (int j = 1; j <= ans; j++) cout << s[i][j] << endl;
        break;
      }
      ans = 0;
    }
  return 0;
}
