#include <bits/stdc++.h>
using namespace std;
inline int read(register int ans = 0, register int sgn = ' ',
                register int ch = getchar()) {
  for (; ch < '0' || ch > '9'; sgn = ch, ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; (ans *= 10) += ch - '0', ch = getchar())
    ;
  return sgn - '-' ? ans : -ans;
}
char _Ob[1000000 + 5], *_O = _Ob, _Os[25], *_Ot;
template <typename T>
inline void Out(T x) {
  if (!x) {
    (*_O++ = '0');
    return;
  }
  if (x < 0) (*_O++ = '-'), x = -x;
  for (_Ot = _Os; x; *_Ot++ = x % 10 + '0', x /= 10)
    ;
  for (; _Ot != _Os; (*_O++ = *--_Ot))
    ;
  if (_O - _Ob >= 1000000 - 50) fwrite(_Ob, 1, _O - _Ob, stdout), _O = _Ob;
}
bool f[155], g[155], h[155];
int lf, lg, lh, n, m;
int main() {
  n = read(), g[0] = 1, lg = 0, f[1] = 1, lf = 1;
  for (register int j; --n;) {
    lh = lf + 1, memcpy(h + 1, f, -~lf), h[0] = 0;
    for (j = 0; j <= lh; h[j] = h[j] ^ g[j], j++)
      ;
    lg = lf, memcpy(g, f, -~lf), lf = lh, memcpy(f, h, -~lf);
  }
  printf("%d\n", lf);
  for (register int i = 0; i <= lf; printf("%d ", f[i]), i++)
    ;
  putchar('\n');
  printf("%d\n", lg);
  for (register int i = 0; i <= lg; printf("%d ", g[i]), i++)
    ;
  putchar('\n');
  return 0;
}
