#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n, i, j, add = -1;
    cin >> n;
    vector<int> a, b, c;
    a.push_back(1);
    for (i = 0; i < n; i++) {
      c = a;
      a.push_back(0);
      for (j = a.size() - 1; j > 0; j--) a[j] = a[j - 1];
      a[0] = 0;
      for (j = 0; j < b.size(); j++) {
        a[j] += add * b[j];
        if (abs(a[j]) > 1) a[j] = 0;
      }
      add = add * -1;
      b = c;
    }
    cout << a.size() - 1 << "\n";
    for (i = 0; i < a.size(); i++) cout << a[i] << " ";
    cout << "\n" << b.size() - 1 << "\n";
    for (i = 0; i < b.size(); i++) cout << b[i] << " ";
  }
  return 0;
}
