#include <bits/stdc++.h>
using namespace std;
void process(vector<int>& p, vector<int>& q, vector<int>& result) {
  result = vector<int>(((int)(p.size())) + 1);
  for (int i = 0; i < ((int)(p.size())); i++) result[i + 1] = p[i];
  bool positive = true;
  for (int i = 0; i < ((int)(q.size())); i++)
    if ((result[i] == 1 && q[i] == 1) || (result[i] == -1 && q[i] == -1)) {
      positive = false;
      break;
    }
  if (positive)
    for (int i = 0; i < ((int)(q.size())); i++) result[i] += q[i];
  else
    for (int i = 0; i < ((int)(q.size())); i++) result[i] -= q[i];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<vector<int> > preprop(153);
  preprop[0].push_back(1);
  preprop[1].push_back(0);
  preprop[1].push_back(1);
  for (int i = 2; i < 153; i++) {
    process(preprop[i - 1], preprop[i - 2], preprop[i]);
  }
  int n;
  cin >> n;
  cout << ((int)(preprop[n].size())) - 1 << endl;
  for (int i = 0; i < ((int)(preprop[n].size())); i++)
    cout << preprop[n][i] << " ";
  cout << endl;
  cout << ((int)(preprop[n - 1].size())) - 1 << endl;
  for (int i = 0; i < ((int)(preprop[n - 1].size())); i++)
    cout << preprop[n - 1][i] << " ";
  cout << endl;
  return 0;
}
