#include <bits/stdc++.h>
using namespace std;
vector<int> a[155];
int main() {
  a[0].push_back(1);
  a[1].push_back(0);
  a[1].push_back(1);
  for (int i = 2; i <= 150; i++) {
    a[i].push_back(0);
    for (int j = 0; j < a[i - 1].size(); j++) {
      a[i].push_back(a[i - 1][j]);
    }
    for (int j = 0; j < a[i - 2].size(); j++) {
      a[i][j] += a[i - 2][j];
      a[i][j] %= 2;
    }
  }
  int n;
  scanf("%d", &n);
  printf("%d\n", (int)a[n].size() - 1);
  for (auto it : a[n]) printf("%d ", it);
  printf("\n%d\n", (int)a[n - 1].size() - 1);
  for (auto it : a[n - 1]) printf("%d ", it);
  printf("\n");
  return 0;
}
