#include <bits/stdc++.h>
using namespace std;
const int inf = 1E7;
int a[2][200], u, v, c[200], n;
bool check() {
  for (int i = 0; i <= n; i++)
    if (c[i] > 1 || c[i] < -1) return 0;
  return 1;
}
void dfs(int x) {
  if (x > n) {
    cout << n << endl;
    for (int i = 0; i <= n; i++) printf("%d ", a[u][i]);
    printf("\n%d\n", n - 1);
    for (int i = 0; i < n; i++) printf("%d ", a[v][i]);
    return;
  }
  for (int i = 1; i <= x; i++) c[i] = a[u][i - 1];
  c[0] = 0;
  for (int i = 0; i < x; i++) c[i] += a[v][i];
  if (!check()) {
    for (int i = 1; i <= x; i++) c[i] = a[u][i - 1];
    c[0] = 0;
    for (int i = 0; i < x; i++) c[i] -= a[v][i];
  }
  for (int i = 0; i <= x; i++) a[v][i] = c[i];
  swap(u, v);
  dfs(x + 1);
}
int main() {
  cin >> n;
  u = 0;
  v = 1;
  a[0][0] = 1;
  dfs(1);
}
