#include <bits/stdc++.h>
using namespace std;
const int _ = 1e2;
const int maxn = 2e5 + _;
const int mod = 1e9 + 7;
inline int ad(int x, int y) { return x >= mod - y ? x - mod + y : x + y; }
inline int re(int x, int y) { return x < y ? x - y + mod : x - y; }
inline int mu(int x, int y) { return (long long)x * y % mod; }
inline int qp(int x, long long y) {
  int r = 1;
  while (y) {
    if (y & 1) r = mu(r, x);
    x = mu(x, x), y >>= 1;
  }
  return r;
}
inline int iv(int x) { return qp(x, mod - 2); }
int len, a[1100], blen, b[1100], tlen, t[1100];
int main() {
  int n;
  scanf("%d", &n);
  blen = 0;
  len = 0, a[0] = 1;
  for (int i = 1; i <= n; i++) {
    tlen = len, memcpy(t, a, sizeof(t));
    for (int i = len + 1; i >= 1; i--) a[i] = a[i - 1];
    a[0] = 0;
    len++;
    int op = 1;
    for (int i = 0; i <= len; i++)
      if (a[i] + b[i] > 1 || a[i] + b[i] < -1) op = -1;
    for (int i = 0; i <= len; i++) a[i] += b[i] * op;
    blen = tlen, memcpy(b, t, sizeof(b));
  }
  printf("%d\n", len);
  for (int i = 0; i < len; i++) printf("%d ", a[i]);
  printf("%d\n", a[len]);
  printf("%d\n", blen);
  for (int i = 0; i < blen; i++) printf("%d ", b[i]);
  printf("%d\n", b[blen]);
  return 0;
}
