#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int Num = 0, F = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') F = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    Num = (Num << 3) + (Num << 1) + (ch ^ 48);
    ch = getchar();
  }
  return Num * F;
}
int n[2], a[2][200];
void revgcd(int l, int r) {
  for (int i = 0; i <= n[l]; ++i) (a[r][i + 1] += a[l][i]) %= 2;
  n[r] = n[l] + 1;
}
int main() {
  int T = read(), l = 0, r = 1;
  a[0][0] = 1;
  while (T--) {
    revgcd(l, r);
    l ^= r ^= l ^= r;
  }
  printf("%d\n", n[l]);
  for (int i = 0; i <= n[l]; ++i) printf("%d ", a[l][i]);
  printf("\n%d\n", n[r]);
  for (int i = 0; i <= n[r]; ++i) printf("%d ", a[r][i]);
  return 0;
}
