#include <bits/stdc++.h>
using namespace std;
vector<int> multiply(vector<int> a) {
  vector<int> ret;
  ret.push_back(0);
  for (int i = 0; i < a.size(); i++) {
    ret.push_back(a[i]);
  }
  return ret;
}
vector<int> add(vector<int> a, vector<int> b) {
  while (a.size() < b.size()) {
    a.push_back(0);
  }
  while (b.size() < a.size()) {
    b.push_back(0);
  }
  vector<int> ret;
  for (int i = 0; i < a.size(); i++) {
    ret.push_back((a[i] + b[i]) % 2);
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> a;
  vector<int> b;
  a.push_back(0);
  a.push_back(1);
  b.push_back(1);
  for (int i = 1; i < n; i++) {
    vector<int> old_a;
    for (int j = 0; j < a.size(); j++) {
      old_a.push_back(a[j]);
    }
    a = add(multiply(old_a), b);
    b = old_a;
  }
  cout << a.size() - 1 << endl;
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << " ";
  }
  cout << endl;
  cout << b.size() - 1 << endl;
  for (int i = 0; i < b.size(); i++) {
    cout << b[i] << " ";
  }
  cout << endl;
}
