#include <bits/stdc++.h>
using namespace std;
int n;
int a[1000], b[1000], c[1000];
int main() {
  cin >> n;
  a[0] = 0;
  a[1] = 1;
  b[0] = 1;
  int alen = 2;
  int blen = 1;
  for (int _ = 0; _ < (int)(n - 1); ++_) {
    for (int i = 0; i < (int)(alen + 1); ++i) c[i] = 0;
    for (int i = 0; i < (int)(alen); ++i) c[i + 1] += a[i];
    for (int i = 0; i < (int)(blen); ++i) c[i] += b[i];
    bool ok = true;
    for (int i = 0; i < (int)(alen + 1); ++i)
      if (abs(c[i]) > 1) {
        ok = false;
      }
    if (!ok) {
      for (int i = 0; i < (int)(alen + 1); ++i) c[i] = 0;
      for (int i = 0; i < (int)(alen); ++i) c[i + 1] -= a[i];
      for (int i = 0; i < (int)(blen); ++i) c[i] += b[i];
      ok = true;
      for (int i = 0; i < (int)(alen + 1); ++i)
        if (abs(c[i]) > 1) {
          ok = false;
        }
      if (!ok) {
        cerr << "!!" << endl;
        return 0;
      }
    }
    for (int i = 0; i < (int)(alen); ++i) b[i] = a[i];
    for (int i = 0; i < (int)(alen + 1); ++i) a[i] = c[i];
    ++alen;
    ++blen;
  }
  if (a[alen - 1] < 0) {
    for (int i = 0; i < (int)(alen); ++i) a[i] *= -1;
  }
  if (b[blen - 1] < 0) {
    for (int i = 0; i < (int)(blen); ++i) b[i] *= -1;
  }
  assert(a[alen - 1] == 1);
  assert(b[blen - 1] == 1);
  printf("%d\n", alen - 1);
  for (int i = 0; i < (int)(alen); ++i) printf("%d ", a[i]);
  printf("\n%d\n", blen - 1);
  for (int i = 0; i < (int)(blen); ++i) printf("%d ", b[i]);
  return 0;
}
