#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1001001001;
string next_s(string s) {
  int n = (int)(s.size());
  for (int i = n - 1; i >= 1; --i) {
    if (s[i] - s[i - 1] > 0) {
      s[i] = 'a';
      continue;
    } else {
      s[i] = s[i] + 1;
      return s;
    }
  }
  return s;
}
int fact(int n) {
  if (n == 0) return 1;
  return n * fact(n - 1);
}
int main() {
  int n, a = 0;
  cin >> n;
  int k = 0;
  string s, goal;
  while (n) {
    a += (n - 1) * pow(10, k);
    s += 'a';
    goal += 'a' + k;
    k++;
    n--;
  }
  cout << a << endl;
  while (1) {
    cout << s << endl;
    if (s == goal) break;
    s = next_s(s);
  }
  return 0;
}
