#include <bits/stdc++.h>
using namespace std;
const int maxN = 333 + 10;
int n;
vector<int> A[2];
int main() {
  scanf("%d", &n);
  A[0] = {0, 1};
  A[1] = {1};
  int g = 0;
  for (int i = 2; i <= n; i++) {
    int ng = 1 - g;
    A[ng].push_back(0);
    A[ng].push_back(0);
    bool ok = true;
    for (int j = 0; j < A[g].size(); j++) {
      if (abs(A[ng][j + 1] + A[g][j]) > 1) {
        ok = false;
        break;
      }
    }
    for (int j = 0; j < A[g].size(); j++) {
      if (ok) {
        A[ng][j + 1] += A[g][j];
      } else {
        A[ng][j + 1] -= A[g][j];
      }
    }
    if (A[ng].back() < 0) {
      for (int j = 0; j < A[ng].size(); j++) A[ng][j] = -A[ng][j];
    }
    g = ng;
  }
  for (int w = 0; w < 2; w++) {
    printf("%d\n", (int)A[g].size() - 1);
    for (int j = 0; j < A[g].size(); j++) {
      printf("%d%c", A[g][j], " \n"[j == A[g].size() - 1]);
    }
    g = 1 - g;
  }
  return 0;
}
