#include <bits/stdc++.h>
using namespace std;
int N;
void dfs(string s, char x) {
  if (s.size() == N) {
    cout << s << endl;
  } else {
    for (char c = 'a'; c <= x; c++) {
      cout << "#" << s << " " << c << " " << x << endl;
      dfs(s + c, ((c == x) ? (char)x + 1 : x));
    }
  }
}
int main() {
  cin >> N;
  dfs("", 'a');
  return 0;
}
