#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n + 1);
  vector<int> b(n + 1);
  b[0] = 1;
  a[1] = 1;
  for (int i = 2; i <= n; ++i) {
    vector<int> c = b;
    bool good = true;
    for (int j = 0; j < n; ++j)
      if (abs(c[j + 1] + a[j]) >= 2) good = false;
    int coef = 1;
    if (!good) coef = -1;
    for (int j = 0; j < n; ++j) c[j + 1] += coef * a[j];
    if (any_of(begin(c), end(c), [](const int x) { return abs(x) > 1; })) {
      cout << ("BAD") << '\n';
      exit(0);
    };
    b = a;
    a = c;
  }
  if (a.back() < 0)
    transform(begin(a), end(a), begin(a), [](const int x) { return -x; });
  while (b.back() == 0) b.pop_back();
  if (b.back() < 0)
    transform(begin(b), end(b), begin(b), [](const int x) { return -x; });
  cout << a.size() - 1 << endl;
  for (int i = 0; i < a.size(); ++i) cout << a[i] << " \n"[i == n];
  cout << b.size() - 1 << endl;
  for (int i = 0; i < b.size(); ++i) cout << b[i] << " \n"[i == b.size() - 1];
}
