#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200;
struct poly {
  vector<int> a;
  poly() : a(MAXN) {}
  poly operator+(const poly &b) const {
    poly res;
    int carry = 0;
    for (int i = 0; i < MAXN; ++i) {
      res.a[i] = a[i] + b.a[i] + carry;
      carry = res.a[i] / 3;
      res.a[i] %= 3;
      if (res.a[i] == 2) {
        res.a[i] = -1;
      } else if (res.a[i] == -2) {
        res.a[i] = 1;
      }
    }
    return res;
  }
  void shift() {
    for (int i = MAXN - 1; i > 0; --i) a[i] = a[i - 1];
    a[0] = 0;
  }
  void print() {
    int mx = 0;
    for (int i = 0; i < MAXN; ++i) {
      if (a[i]) mx = max(mx, i);
    }
    printf("%d\n", mx);
    for (int i = 0; i <= mx; ++i) printf("%d ", a[i]);
    printf("\n");
  }
};
int main() {
  int n;
  scanf("%d", &n);
  vector<poly> f(MAXN);
  f[1].a[0] = 1;
  for (int i = 2; i < MAXN; ++i) {
    f[i].a = f[i - 1].a;
    f[i].shift();
    f[i] = f[i] + f[i - 2];
  }
  f[n + 1].print();
  f[n].print();
  return 0;
}
