#include <bits/stdc++.h>
using namespace std;
struct poly {
  int n;
  int a[155];
  poly Time() {
    poly c;
    c.n = n + 1;
    for (int i = n + 1; i > 0; i--) c.a[i] = a[i - 1];
    c.a[0] = 0;
    return c;
  }
  poly() {
    n = 0;
    memset(a, 0, sizeof(a));
  }
  void Print() {
    printf("%d\n", n);
    for (int i = 0; i <= n; i++) printf("%d ", a[i]);
    puts("");
    return;
  }
};
poly operator+(poly a, poly b) {
  poly c;
  c.n = max(a.n, b.n);
  for (int i = 0; i <= c.n; i++) c.a[i] = a.a[i] + b.a[i];
  return c;
}
poly Mod(poly a) {
  for (int i = 0; i <= a.n; i++) a.a[i] %= 2;
  return a;
}
bool check(poly a) {
  for (int i = 0; i <= a.n; i++) {
    if (abs(a.a[i]) > 1) return 0;
  }
  return 1;
}
int r;
poly p[155];
int main() {
  scanf("%d", &r);
  p[0].a[0] = 1;
  p[1].n = 1;
  p[1].a[1] = 1;
  for (int i = 2; i <= r; i++) {
    p[i] = Mod(p[i - 1].Time() + p[i - 2]);
  }
  p[r].Print();
  p[r - 1].Print();
  return 0;
}
