#include <bits/stdc++.h>
using namespace std;
void dout() { cerr << '\n'; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << " " << H;
  dout(T...);
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct poly {
  int a[151];
  poly() { memset(&a, 0, sizeof(a)); }
  poly operator^(const poly& p) const {
    poly res;
    for (int i = 0; i < 151; i++) {
      res.a[i] = a[i] ^ p.a[i];
    }
    return res;
  }
  poly operator<<(const int& x) const {
    poly res;
    for (int i = x; i < 151; i++) {
      res.a[i] = a[i - x];
    }
    return res;
  }
  void output() {
    int x = 0;
    for (int i = 150; i >= 0; i--) {
      if (a[i]) {
        x = i;
        break;
      }
    }
    cout << x << '\n';
    for (int i = 0; i <= x; i++) {
      cout << a[i] << ' ';
    }
    cout << '\n';
  }
};
poly p[151];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int n;
  cin >> n;
  p[0].a[0] = 1;
  p[1].a[1] = 1;
  for (int i = 2; i <= n; i++) {
    p[i] = (p[i - 1] << 1) ^ p[i - 2];
  }
  p[n].output();
  p[n - 1].output();
}
