#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 1;
int a[MAX], b[MAX], c[MAX];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  a[1] = 1;
  b[0] = 1;
  for (int i = 1; i < n; ++i) {
    for (int j = i; j >= 0; --j) {
      c[j] = a[j];
      a[j + 1] = a[j];
    }
    a[0] = 0;
    int multiplier = 1;
    for (int j = i - 1; j >= 0; --j) {
      if (a[j] == b[j] && ((a[j] < 0) ? (-a[j]) : a[j]) == 1) multiplier = -1;
    }
    for (int j = i - 1; j >= 0; --j) a[j] += b[j] * multiplier;
    for (int j = i; j >= 0; --j) b[j] = c[j];
  }
  cout << n << endl;
  for (int i = 0; i <= n; ++i) cout << a[i] << ' ';
  cout << endl << n - 1 << endl;
  for (int i = 0; i < n; ++i) cout << b[i] << ' ';
  return 0;
}
