#include <bits/stdc++.h>
using namespace std;
int an, a[(300 + 5)], b[(300 + 5)], ta[(300 + 5)], tb[(300 + 5)];
void Solve(int h, int m) {
  if (!m) {
    an = h;
    return;
  }
  for (int i = (0); i <= (int)(h + 1); ++i) ta[i] = tb[i] = 0;
  for (int i = (0); i <= (int)(h); ++i) ta[i] = a[i], tb[i] = b[i];
  for (int i = (0); i <= (int)(h); ++i) b[i] = ta[i];
  ta[0] = 0;
  for (int i = (0); i <= (int)(h); ++i) ta[i + 1] = -a[i];
  bool flag = true;
  for (int i = (0); i <= (int)(h + 1); ++i)
    if (abs(ta[i] + tb[i]) > 1) {
      flag = false;
      break;
    }
  if (!flag) {
    for (int i = (0); i <= (int)(h + 1); ++i) ta[i] = -ta[i];
  }
  flag = true;
  for (int i = (0); i <= (int)(h + 1); ++i)
    if (abs(ta[i] + tb[i]) > 1) {
      flag = false;
      break;
    }
  if (flag) {
    for (int i = (0); i <= (int)(h + 1); ++i) a[i] = ta[i] + tb[i];
    Solve(h + 1, m - 1);
  } else {
    ta[h + 1] = 0;
    for (int i = (0); i <= (int)(h); ++i) ta[i] = a[i];
    for (int i = (0); i <= (int)(h); ++i)
      if (abs(ta[i] + tb[i]) > 1) {
        flag = false;
        break;
      }
    if (!flag)
      for (int i = (0); i <= (int)(h); ++i) ta[i] = -ta[i];
    for (int i = (0); i <= (int)(h); ++i) a[i] = ta[i] + tb[i];
    Solve(h, m - 1);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  a[0] = 1;
  b[0] = 0;
  Solve(0, n);
  if (a[an] != 1) {
    for (int i = (0); i <= (int)(an); ++i) a[i] = b[i] = ta[i] = tb[i] = 0;
    a[0] = -1;
    b[0] = 0;
    Solve(0, n);
  }
  printf("%d\n%d", an, a[0]);
  for (int i = (1); i <= (int)(an); ++i) printf(" %d", a[i]);
  puts("");
  if (b[an - 1] == -1) {
    for (int i = (0); i <= (int)(an - 1); ++i) b[i] = -b[i];
  }
  printf("%d\n%d", an - 1, b[0]);
  for (int i = (1); i <= (int)(an - 1); ++i) printf(" %d", b[i]);
  puts("");
  return 0;
}
