#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  vector<bool> p1{1}, p0;
  int64_t n;
  cin >> n;
  while (n--) {
    p0.push_back(0);
    p0.push_back(0);
    auto it0 = p0.begin();
    ++it0;
    for (auto it1 = p1.begin(); it1 != p1.end(); ++it0, ++it1)
      *it0 = *it0 ^ *it1;
    swap(p0, p1);
  }
  cout << p1.size() - 1 << '\n';
  for (auto p : p1) cout << p << ' ';
  cout << '\n' << p0.size() - 1 << '\n';
  for (auto p : p0) cout << p << ' ';
  cout << '\n';
  return 0;
}
