#include <bits/stdc++.h>
using namespace std;
long long s[10000], g[10000], v[10000];
signed main() {
  long long n;
  cin >> n;
  s[0] = 1;
  n--;
  g[1] = 1;
  long long nn = n + 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < 1000; j++) {
      v[j] = 0;
    }
    for (long long j = 1; j <= i + 2; j++) {
      v[j] = g[j - 1];
    }
    bool f = 0;
    for (long long j = 0; j <= i; j++) {
      v[j] += s[j];
      if (abs(v[j]) > 1) {
        f = 1;
        break;
      }
    }
    if (!f) {
      for (long long j = 0; j <= i + 2; j++) {
        s[j] = g[j];
        g[j] = v[j];
      }
      continue;
    }
    f = 0;
    for (long long j = 0; j < 1000; j++) {
      v[j] = 0;
    }
    for (long long j = 1; j <= i + 2; j++) {
      v[j] = -g[j - 1];
    }
    for (long long j = 0; j <= i; j++) {
      v[j] += s[j];
      if (abs(v[j]) > 1) {
        f = 1;
        break;
      }
    }
    if (!f) {
      for (long long j = 0; j <= i + 2; j++) {
        s[j] = g[j];
        g[j] = v[j];
      }
      continue;
    }
  }
  if (g[nn] == -1) {
    for (long long j = 0; j <= nn; j++) {
      g[j] = -g[j];
    }
  }
  if (s[nn - 1] == -1) {
    for (long long j = 0; j <= nn; j++) {
      s[j] = -s[j];
    }
  }
  cout << nn << '\n';
  for (long long j = 0; j <= nn; j++) {
    cout << g[j] << ' ';
  }
  cout << '\n' << nn - 1 << '\n';
  for (long long j = 0; j <= nn - 1; j++) {
    cout << s[j] << ' ';
  }
}
