#include <bits/stdc++.h>
using namespace std;
struct Pol {
  int n, d[205];
} p[205];
Pol operator+(Pol a, Pol b) {
  int i;
  Pol c;
  c.n = max(a.n, b.n);
  memset(c.d, 0, sizeof(c.d));
  for (i = 0; i <= c.n; i++) c.d[i] = a.d[i] + b.d[i];
  return c;
}
Pol operator-(Pol a, Pol b) {
  int i;
  Pol c;
  c.n = max(a.n, b.n);
  memset(c.d, 0, sizeof(c.d));
  for (i = 0; i <= c.n; i++) c.d[i] = a.d[i] - b.d[i];
  return c;
}
Pol operator*(Pol a, Pol b) {
  int i, j;
  Pol c;
  c.n = a.n + b.n;
  memset(c.d, 0, sizeof(c.d));
  for (i = 0; i <= a.n; i++)
    for (j = 0; j <= b.n; j++) c.d[i + j] += a.d[i] * b.d[j];
  return c;
}
bool Valid(Pol a) {
  int i;
  for (i = 0; i <= a.n; i++)
    if (abs(a.d[i]) >= 2) return false;
  return true;
}
int main() {
  int n, i;
  Pol temp, mul;
  scanf("%d", &n);
  p[0].d[0] = 1;
  p[1].n = p[1].d[1] = 1;
  mul = p[1];
  for (i = 2; i <= n; i++) {
    temp = p[i - 1] * mul + p[i - 2];
    if (Valid(temp))
      p[i] = temp;
    else
      p[i] = p[i - 1] * mul - p[i - 2];
  }
  printf("%d\n", n);
  for (i = 0; i <= n; i++) printf("%d ", p[n].d[i]);
  printf("\n%d\n", n - 1);
  for (i = 0; i <= n - 1; i++) printf("%d ", p[n - 1].d[i]);
  printf("\n");
  return 0;
}
