#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
T gcd(T a, T b) {
  return a ? gcd(b % a, a) : b;
}
template <class T>
T sqr(T a) {
  return a * a;
}
template <class T>
T sgn(T a) {
  return a > 0 ? 1 : (a < 0 ? -1 : 0);
}
int n;
int m;
const int N = 300;
int a[N + 10], b[N + 10], c[N + 10];
int main() {
  scanf("%d", &n);
  a[0] = 1;
  for (int i = 0; i < n; i++) {
    bool ok = true;
    for (int sign = -1; sign <= 1; sign += 2) {
      memset(c, 0, sizeof(c));
      ok = true;
      for (int j = 0; j < N && ok; j++) {
        c[j] = (c[j] + b[j]);
        if (abs(c[j]) > 1) ok = false;
        c[j + 1] = a[j] * sign;
      }
      if (ok) break;
    }
    if (!ok) {
      puts("Ooops");
      return 0;
    }
    memcpy(b, a, sizeof(a));
    memcpy(a, c, sizeof(a));
  }
  printf("%d\n", n);
  for (int j = 0; j <= n; j++) printf("%d ", a[j] / a[n]);
  puts("");
  printf("%d\n", n - 1);
  for (int j = 0; j < n; j++) printf("%d ", b[j] / b[n - 1]);
  puts("");
  return 0;
}
