#include <bits/stdc++.h>
using namespace std;
string alpha[] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
int N;
void dfsa(string s, char mx) {
  if (s.length() == N) {
    cout << s << endl;
  } else {
    for (char c = 'a'; c <= mx; c++) {
      dfsa(s + c, c == mx ? (char)mx + 1 : mx);
    }
  }
}
int main() {
  cin >> N;
  cout << N << endl;
  string s = "";
  dfsa(s, 'a');
}
