#include <bits/stdc++.h>
using namespace std;
const int N = 200;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, cnt, flag = 1;
int a[N], b[N], c[N];
int main() {
  cnt = n = read();
  a[0] = -1, b[0] = 0;
  while (cnt--) {
    for (int i = 0; i < N - 1; i++) c[i + 1] = a[i];
    c[0] = 0;
    for (int i = 0; i < N; i++) c[i] += b[i];
    for (int i = 0; i < N; i++)
      if (abs(c[i]) > 1) {
        for (int i = 0; i < N - 1; i++) c[i + 1] = a[i] * (-1);
        c[0] = 0;
        for (int i = 0; i < N; i++) c[i] += b[i];
        break;
      }
    for (int i = 0; i < N; i++) b[i] = a[i], a[i] = c[i];
  }
  cout << n << endl;
  if (a[n] < 0)
    flag = -1;
  else
    flag = 1;
  for (int i = 0; i <= n; i++) cout << a[i] * flag << " ";
  cout << endl << n - 1 << endl;
  if (b[n - 1] < 0)
    flag = -1;
  else
    flag = 1;
  for (int i = 0; i <= n - 1; i++) cout << b[i] * flag << " ";
}
