#include <bits/stdc++.h>
using namespace std;
const int N = 505;
const long long p = 1e9 + 7;
int main() {
  int n;
  scanf("%d", &n);
  int a[155] = {0}, b[155] = {0};
  a[0] = 1;
  b[0] = 0;
  for (int i = 1; i <= n; i++) {
    int flag = 0;
    for (int j = 1; j < 155; j++)
      if (b[j] + a[j - 1] > 1 || b[j] + a[j - 1] < -1) flag = 1;
    int tmp[155];
    for (int j = 0; j < 155; j++) tmp[j] = b[j];
    for (int j = 0; j < 155; j++) b[j] = a[j];
    for (int j = 1; j < 155; j++) a[j] = (flag ? -1 : 1) * b[j - 1];
    a[0] = 0;
    for (int j = 0; j < 155; j++) a[j] += tmp[j];
  }
  int f, f1;
  int nn, mm;
  for (int i = 154; i >= 0; i--)
    if (a[i]) {
      f = (a[i] > 0 ? 1 : -1);
      nn = i;
      break;
    }
  for (int i = 154; i >= 0; i--)
    if (b[i]) {
      f1 = (b[i] > 0 ? 1 : -1);
      mm = i;
      break;
    }
  printf("%d\n", nn);
  for (int i = 0; i <= nn; i++) printf("%d ", f * a[i]);
  printf("\n");
  printf("%d\n", mm);
  for (int i = 0; i <= mm; i++) printf("%d ", f1 * b[i]);
  printf("\n");
  return 0;
}
