#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  set<string> st, tmp;
  string s = "a", t1 = "", t2 = "";
  char c = 'b';
  bool fl = 0;
  st.insert(s);
  for (long long i = 0; i < n - 1; i++) {
    c = 'b';
    for (auto y : st) {
      t1 = "a" + y;
      t2 = y + "a";
      tmp.insert(t1);
      tmp.insert(t2);
    }
    for (long long k = 1; k < 26; k++) {
      for (auto y : st) {
        fl = 0;
        for (long long j = 0; j < y.length(); j++) {
          if (y[j] == (c - 1)) fl = 1;
        }
        cout << fl << ' ';
        cout << c;
        cout << endl;
        if (fl) {
          t1 = y + c;
          tmp.insert(t1);
        }
      }
      c++;
    }
    st.clear();
    for (auto z : tmp) st.insert(z);
    tmp.clear();
  }
  for (auto x : st) cout << x << '\n';
}
