#include <bits/stdc++.h>
using namespace std;
struct poly {
  int tot, a[1000];
  void init() { memset(a, 0, sizeof(a)), tot = 0; }
  void sh() {
    for (int i = tot; i >= 0; i--) a[i + 1] = a[i];
    a[0] = 0, tot++;
  }
  void print() {
    cout << tot << endl;
    for (int i = 0; i <= tot; i++) printf("%d ", a[i]);
    cout << endl;
  }
};
poly operator+(poly a, poly b) {
  poly tmp;
  tmp.init();
  tmp.tot = max(a.tot, b.tot);
  for (int i = 0; i <= tmp.tot; i++) tmp.a[i] = (a.a[i] + b.a[i]) % 2;
  return tmp;
}
int main() {
  poly p0, p1;
  p0.tot = 0, p0.a[0] = 1;
  p1.tot = 1, p1.a[1] = 1;
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    poly tmp = p1;
    p1.sh();
    p1 = p1 + p0;
    p0 = tmp;
  }
  p1.print();
  p0.print();
}
