#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n == 1) {
    cout << "1\n0 1\n0\n1";
    return 0;
  }
  vector<long long> p1, p2;
  p1.push_back(1);
  p1.push_back(0);
  p2.push_back(1);
  for (long long i = 1; i < n; i++) {
    vector<long long> temp = p1;
    p1.push_back(0);
    for (long long j = 0; j < p2.size(); j++) {
      p1[j + 2] += p2[j];
      p1[j + 2] %= 2LL;
    }
    p2 = temp;
  }
  reverse(p1.begin(), p1.end());
  reverse(p2.begin(), p2.end());
  cout << p1.size() - 1 << "\n";
  for (long long i = 0; i < p1.size(); i++) cout << p1[i] << " ";
  cout << "\n";
  cout << p2.size() - 1 << "\n";
  for (long long i = 0; i < p2.size(); i++) cout << p2[i] << " ";
}
