#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> p1(n + 1), p2(n + 1);
  p1[1] = p2[0] = 1;
  for (int i = 1; i < n; ++i) {
    bool flag = false;
    for (int j = 0; j <= i; ++j) {
      p2[j + 1] += p1[j];
      if (p2[j + 1] > 1 || p2[j + 1] < -1) flag = true;
    }
    if (flag) {
      for (int j = 0; j <= i; ++j) p2[j + 1] -= 2 * p1[j];
    }
    for (int j = 0; j <= i + 1; ++j) swap(p1[j], p2[j]);
  }
  p2.pop_back();
  if (p1[n] < 0)
    for (int &c : p1) c *= -1;
  if (p2[n - 1] < 0)
    for (int &c : p2) c *= -1;
  printf("%d\n", n);
  for (int c : p1) printf("%d ", c);
  puts("");
  printf("%d\n", n - 1);
  for (int c : p2) printf("%d ", c);
  puts("");
  return 0;
}
