#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e6 + 10;
const long long INF = 1e18;
const long double EPS = 1e-12;
vector<int> a, b;
int main() {
  int nn;
  cin >> nn;
  a.push_back(1);
  a.push_back(0);
  b.push_back(1);
  for (int i = 0; i < (int)nn - 1; i++) {
    vector<int> aa, bb;
    for (int i = 0; i < (int)a.size(); i++) {
      bb.push_back(a[i]);
    }
    for (int i = 0; i < (int)a.size(); i++) {
      aa.push_back(a[i]);
    }
    aa.push_back(0);
    int n = (int)(aa.size());
    int m = b.size();
    for (int i = 0; i < (int)m; i++) {
      aa[n - 1 - i] += b[m - 1 - i];
      aa[n - 1 - i] %= 2;
    }
    a.clear();
    b.clear();
    for (int i = 0; i < (int)aa.size(); i++) a.push_back(aa[i]);
    for (int i = 0; i < (int)bb.size(); i++) b.push_back(bb[i]);
  }
  int n = (int)(a.size());
  cout << n - 1 << endl;
  for (int i = 0; i < (int)n; i++) {
    cout << a[n - 1 - i] << " ";
  }
  cout << endl;
  int m = (int)(b.size());
  cout << m - 1 << endl;
  for (int i = 0; i < (int)m; i++) cout << b[m - 1 - i] << " ";
  cout << endl;
  return 0;
}
