#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 1000;
std::vector<std::vector<long long> > poly;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long base = 0;
  std::vector<long long> fp;
  fp.push_back(1);
  long long n;
  poly.push_back(fp);
  fp.clear();
  fp.push_back(1);
  fp.push_back(0);
  poly.push_back(fp);
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    std::vector<long long> pp = poly[i - 2];
    std::vector<long long> np = poly[i - 1];
    np.push_back(0);
    reverse(pp.begin(), pp.end());
    pp.push_back(0);
    pp.push_back(0);
    reverse(pp.begin(), pp.end());
    long long fl = 0;
    for (long long i = 0; i < pp.size(); i++) {
      np[i] = (np[i] + pp[i] + 2) % 2;
    }
    poly.push_back(np);
  }
  if (poly[n][0] == -1) {
    for (long long i = poly[n].size() - 1; i >= 0; i--)
      poly[n][i] = -poly[n][i];
  }
  if (poly[n - 1][0] == -1) {
    for (long long i = poly[n - 1].size() - 1; i >= 0; i--)
      poly[n - 1][i] = -poly[n - 1][i];
  }
  cout << poly[n].size() - 1 << endl;
  for (long long i = poly[n].size() - 1; i >= 0; i--) cout << poly[n][i] << " ";
  cout << endl;
  cout << poly[n - 1].size() - 1 << endl;
  for (long long i = poly[n - 1].size() - 1; i >= 0; i--)
    cout << poly[n - 1][i] << " ";
  cout << endl;
  return 0;
}
