#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000;
inline int read() {
  int rtn = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) rtn = (rtn << 1) + (rtn << 3) + ch - '0';
  return rtn * f;
}
int ans1[maxn], ans2[maxn], tmp[maxn];
int main() {
  int n = read();
  ans1[++ans1[0]] = 1;
  ans2[++ans2[0]] = 0;
  ans2[++ans2[0]] = 1;
  for (int i = 2; i <= n; i++) {
    tmp[0] = 0;
    swap(ans1, ans2);
    for (int i = 1; i <= ans2[0]; i++) tmp[++tmp[0]] = ans2[i];
    for (int i = 1; i <= ans1[0]; i++) ans2[i + 1] = ans1[i];
    ans2[1] = 0;
    ans2[0] = ans1[0] + 1;
    int flag = -1;
    for (int i = 1; i <= ans2[0]; i++) {
      if (abs(tmp[i] - ans2[i]) > 1) {
        flag = 1;
        break;
      }
    }
    for (int i = 1; i <= ans2[0]; i++) ans2[i] = ans2[i] + flag * tmp[i];
  }
  printf("%d\n", ans2[0] - 1);
  for (int i = 1; i <= ans2[0]; i++) printf("%d ", ans2[i]);
  printf("\n%d\n", ans1[0] - 1);
  for (int i = 1; i <= ans1[0]; i++) printf("%d ", ans1[i]);
  return 0;
}
