#include <bits/stdc++.h>
using namespace std;
vector<int> sum(vector<int> a, vector<int> b) {
  bool f = true;
  vector<int> v(max(a.size(), b.size()));
  for (int i = 0; i < v.size(); i++) {
    if (i < a.size()) v[i] += a[i];
    if (i < b.size()) v[i] += b[i];
    if (abs(v[i]) > 1) f = false;
  }
  if (f) return v;
  for (int i = 0; i < v.size(); i++) {
    v[i] = 0;
    if (i < a.size()) v[i] += a[i];
    if (i < b.size()) v[i] -= b[i];
  }
  return v;
}
vector<int> gun(vector<int> a) {
  vector<int> v;
  v.push_back(0);
  for (auto u : a) v.push_back(u);
  return v;
}
vector<int> A[200], B[200];
void get(int idx) {
  B[idx] = A[idx - 1];
  A[idx] = sum(gun(B[idx]), B[idx - 1]);
  return;
}
int main() {
  A[1] = {0, 1};
  B[1] = {1};
  for (int i = 2; i <= 150; i++) get(i);
  int n;
  cin >> n;
  cout << A[n].size() - 1 << '\n';
  for (auto u : A[n]) cout << u << ' ';
  cout << endl;
  cout << B[n].size() - 1 << '\n';
  for (auto u : B[n]) cout << u << ' ';
  cout << endl;
}
