#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a{1, 1}, b{1, 0}, c{1};
  int n;
  cin >> n;
  if (n == 1) {
    cout << "1\n0 1\n0\n1\n";
    exit(0);
  }
  for (int i = 0; i < n - 1; i++) {
    c = b;
    b = a;
    a.push_back(c.back());
    for (int j = a.size() - 2, k = c.size() - 2; j >= a.size() - c.size();
         j--, k--)
      a[j] += c[k];
    for (int j = a.size() - 2; j >= a.size() - c.size(); j--)
      if (abs(a[j]) > 1) a[j] = 0;
  }
  cout << a.size() - 1 << endl;
  for (int i = a.size() - 1; i >= 0; i--) cout << a[i] << ' ';
  cout << endl;
  cout << b.size() - 1 << endl;
  for (int i = b.size() - 1; i >= 0; i--) cout << b[i] << ' ';
  cout << endl;
}
