#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long linf = 1e18;
const int N = 2000 + 10;
const double eps = 1e-5;
const int mo = 1e9 + 7;
int n;
int a[N][N];
int f[N][N];
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  scanf("%d", &n);
  n++;
  f[1][1] = 1;
  f[2][1] = 0, f[2][2] = 1;
  for (int i = 3; i <= n; i++)
    for (int j = 1; j <= i; j++) {
      if (j == 1)
        f[i][j] = i % 2;
      else {
        f[i][j] = f[i - 1][j - 1] ^ f[i - 2][j];
      }
    }
  a[1][1] = 1;
  a[2][1] = 0, a[2][2] = 1;
  for (int i = 3; i <= n; i++) {
    int k = 1;
    for (int j = 1; j <= i; j++) {
      if (a[i - 1][j - 1] && a[i - 1][j - 1] + a[i - 2][j] == 0) {
        k = 1;
      } else if (a[i - 1][j - 1] && a[i - 1][j - 1] == a[i - 2][j]) {
        k = -1;
      }
    }
    for (int j = 1; j <= i; j++) {
      if (j == 1)
        a[i][j] = k * a[i - 2][j];
      else {
        a[i][j] = a[i - 1][j - 1] + k * a[i - 2][j];
      }
    }
  }
  n--;
  cout << n << endl;
  for (int i = 1; i <= n + 1; i++) cout << a[n + 1][i] << " ";
  cout << endl;
  cout << n - 1 << endl;
  for (int i = 1; i <= n; i++) cout << a[n][i] << " ";
  cout << endl;
  return 0;
}
