#include <bits/stdc++.h>
using namespace std;
int C[155][155];
int ans[155][2][155], cnt = 0;
bool vis[150] = {0};
void DFS(int x, int c) {
  int i;
  if (x > 150) return;
  C[x][0] = C[x - 2][0];
  for (i = 1; i < x; i++) {
    C[x][i] = c * C[x - 1][i - 1] + C[x - 2][i];
    if (C[x][i] < -1 || C[x][i] > 1) return;
  }
  C[x][x] = c * C[x - 1][x - 1];
  if (vis[x] == 0 && C[x][x] == C[x - 1][x - 1]) {
    vis[x] = 1;
    ++cnt;
    memcpy(ans[x][0], C[x], sizeof(C[x]));
    memcpy(ans[x][1], C[x - 1], sizeof(C[x - 1]));
  }
  DFS(x + 1, 1);
  DFS(x + 1, -1);
}
int main() {
  int i, j;
  ans[1][0][0] = 0;
  ans[1][0][1] = 1;
  ans[1][1][0] = 1;
  cnt = 1;
  C[0][0] = 1;
  C[1][0] = 0;
  C[1][1] = 1;
  DFS(2, 1);
  DFS(2, -1);
  C[0][0] = -1;
  DFS(2, 1);
  DFS(2, -1);
  int n;
  scanf("%d", &n);
  printf("%d\n", n);
  for (i = 0; i <= n; i++) printf("%d ", ans[n][0][n] * ans[n][0][i]);
  printf("\n");
  printf("%d\n", n - 1);
  for (i = 0; i <= n - 1; i++) printf("%d ", ans[n][0][n] * ans[n][1][i]);
  printf("\n");
  return 0;
}
