#include <bits/stdc++.h>
using namespace std;
const int maxn = 200 + 5;
struct Poly {
  int a[maxn];
  void multy() {
    for (int i = 151; i > 0; i--) a[i] = a[i - 1];
    a[0] = 0;
  }
  void add(Poly p, int k) {
    for (int i = 0; i <= 150; i++) a[i] += p.a[i] * k;
  }
  bool judge() {
    for (int i = 0; i <= 150; i++)
      if (a[i] > 1 || a[i] < -1) return false;
    return true;
  }
  void operator=(const Poly &Rhs) { memcpy(a, Rhs.a, sizeof(a)); }
  void print(int n) {
    for (int i = 0; i <= n; i++) printf("%d ", a[i]);
    cout << endl;
  }
};
int n;
Poly a, b;
Poly ans1, ans2;
int main() {
  scanf("%d", &n);
  a.a[0] = 1;
  for (int i = 0; i < n; i++) {
    Poly t = a;
    a.multy();
    a.add(b, 1);
    if (!a.judge()) a.add(b, -2);
    ans1 = a;
    ans2 = t;
    b = t;
  }
  cout << n << endl;
  ans1.print(n);
  cout << n - 1 << endl;
  ans2.print(n - 1);
}
