#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
bool debug = 1;
const int N = 1e5 + 10;
vector<int> num = {0, 1}, divd = {1}, vez = {0, 1};
vector<int> mult(vector<int> a, vector<int> b) {
  if (a.size() < b.size()) swap(a, b);
  vector<int> ans(a.size() + b.size() - 1);
  for (int ia = 0; ia < a.size(); ia++) {
    for (int ib = 0; ib < b.size(); ib++) {
      ans[ia + ib] += a[ia] * b[ib];
    }
  }
  return ans;
}
vector<int> sub(vector<int> a, vector<int> b) {
  assert(a.size() >= b.size());
  vector<int> ans = a;
  for (int i = 0; i < b.size(); i++) {
    ans[i] -= b[i];
  }
  return ans;
}
vector<int> add(vector<int> a, vector<int> b) {
  assert(a.size() >= b.size());
  vector<int> ans = a;
  for (int i = 0; i < b.size(); i++) {
    ans[i] += b[i];
  }
  return ans;
}
bool go(int n) {
  if (n == 0) return 1;
  vector<int> numaux = add(mult(num, vez), divd);
  bool ok = 1;
  for (int i = 0; i < numaux.size(); i++) {
    if (abs(numaux[i]) >= 2) ok = 0;
  }
  if (!ok) {
    numaux = sub(mult(num, vez), divd);
    ok = 1;
    for (int i = 0; i < numaux.size(); i++) {
      if (abs(numaux[i]) >= 2) ok = 0;
    }
  }
  if (ok) {
    divd = num;
    num = numaux;
    return go(n - 1);
  } else {
    return 0;
    if (debug) cout << "erro" << endl;
  }
}
int main() {
  int n;
  cin >> n;
  num = {0, 1}, divd = {1}, vez = {0, 1};
  if (!go(n - 1))
    if (debug)
      cout << "n"
           << " = " << (n) << endl;
  printf("%d\n", n);
  for (int i = 0; i < num.size(); i++) {
    printf("%d ", num[i]);
  }
  printf("\n");
  printf("%d\n", n - 1);
  for (int i = 0; i < divd.size(); i++) {
    printf("%d ", divd[i]);
  }
  printf("\n");
  return 0;
}
