#include <bits/stdc++.h>
using namespace std;
void ad(vector<int> &a, vector<int> &b) {
  int d = a.size() - b.size();
  for (int i = 0; i < (int)(b.size()); ++i)
    if ((a[i + d] += b[i]) == 2) a[i + d] = 0;
}
void pr(vector<int> &p) {
  printf("%d\n", (int)p.size() - 1);
  for (int i = (int)p.size() - 1; i >= 0; --i) {
    printf("%d", p[i]);
    if (i) printf(" ");
  }
  printf("\n");
}
void vl(vector<int> &p) {}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(2, 0), b(1, 1);
  a[0] = 1;
  for (int i = 1; i < (int)(n); ++i) {
    vector<int> c = a;
    a.push_back(0);
    ad(a, b);
    swap(c, b);
  }
  pr(a);
  pr(b);
}
