#include <bits/stdc++.h>
using namespace std;
const int N = 155;
int n;
int a[N], b[N], A, B;
int main() {
  scanf("%d", &n);
  a[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= A; j++) b[j + 1] = (b[j + 1] + a[j]) % 2;
    B = max(B, A + 1);
    swap(A, B);
    for (int j = 0; j <= A; j++) swap(a[j], b[j]);
  }
  printf("%d\n", A);
  for (int i = 0; i <= A; i++) printf("%d%c", a[i], i == A ? '\n' : ' ');
  printf("%d\n", B);
  for (int i = 0; i <= B; i++) printf("%d%c", b[i], i == B ? '\n' : ' ');
  return 0;
}
