#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  int num = (1 << (n - 1));
  vector<string> ans;
  for (int i = 0; i < num; ++i) {
    string s;
    s = "";
    int k = i;
    for (int j = 0; j < n; ++j) {
      if (k & 1)
        s = 'b' + s;
      else
        s = 'a' + s;
      k >>= 1;
    }
    ans.push_back(s);
  }
  cout << ans.size() << '\n';
  for (string x : ans) cout << x << '\n';
  return 0;
}
