#include <bits/stdc++.h>
using namespace std;
const int MAX = 205;
int n;
struct poly {
  int sz;
  vector<int> p;
  poly() {
    vector<int> v(300, 0);
    p = v;
    sz = 300;
  }
  poly(vector<int> v) {
    p = v;
    sz = v.size();
  }
  poly operator+(const poly &b) const {
    poly res = poly();
    res.sz = max(b.sz, sz);
    for (int i = 0; i <= res.sz; i++) res.p[i] = (p[i] + b.p[i]) % 2;
    return res;
  }
  poly operator*(const poly &b) const {
    poly res = poly();
    res.sz = b.sz + sz;
    for (int i = 0; i <= sz; i++)
      for (int j = 0; j <= b.sz; j++)
        res.p[i + j] = (res.p[i + j] + p[i] * b.p[j]) % 2;
    return res;
  }
  void out() {
    cout << sz << "\n";
    for (int i = 0; i <= sz; i++) cout << p[i] << (i == sz ? "\n" : " ");
  }
} F[MAX];
poly x;
void build() {
  for (int i = 2; i <= 200; i++) F[i] = x * F[i - 1] + F[i - 2];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  F[0].p[0] = 1;
  F[0].sz = 0;
  F[1].p[0] = 0, F[1].p[1] = 1;
  F[1].sz = 1;
  x = F[1];
  build();
  F[n].out();
  F[n - 1].out();
}
