#include <bits/stdc++.h>
using namespace std;
int a[200], b[200], c[200];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int d = 0;
  a[0] = 1;
  b[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = d; j >= 0; j--) {
      c[j] = a[j];
      a[j + 1] = a[j] + b[j + 1];
    }
    a[0] = b[0];
    d++;
    bool tf = true;
    for (int j = 0; j <= d; j++)
      if (abs(a[j]) > 1) {
        tf = false;
        break;
      }
    if (tf) {
      for (int j = 0; j <= d; j++) b[j] = c[j];
      continue;
    }
    for (int j = 0; j <= d; j++) {
      a[j] -= 2 * b[j];
      b[j] = c[j];
    }
  }
  cout << d << endl;
  for (int i = 0; i <= d; i++) cout << a[i] << " ";
  cout << endl;
  cout << d - 1 << endl;
  for (int i = 0; i < d; i++) cout << b[i] << " ";
  cout << endl;
}
