#include <bits/stdc++.h>
using namespace std;
const int Inf = (int)1e9 + 7;
const long long LongInf = (long long)1e18 + 7;
namespace {
inline bool check(const vector<int>& a, const vector<int>& b) {
  for (int i = 0; i < (int)b.size(); i++)
    if (a[i] + b[i] > 1 || a[i] + b[i] < -1) return false;
  return true;
}
void solve() {
  int n;
  cin >> n;
  vector<int> a, b;
  a.insert(a.begin(), 1);
  a.insert(a.begin(), 0);
  b.insert(b.begin(), 1);
  for (int i = 1; i < n; i++) {
    vector<int> aa = a;
    a.insert(a.begin(), 0);
    if (!check(a, b)) {
      for (int j = 0; j < (int)b.size(); j++) b[j] *= -1;
    }
    for (int j = 0; j < (int)b.size(); j++) a[j] = a[j] + b[j];
    b = aa;
  }
  cout << ((int)a.size() - 1) << "\n";
  for (int ax : a) cout << ax << " ";
  cout << "\n";
  cout << ((int)b.size() - 1) << "\n";
  for (int bx : b) cout << bx << " ";
  cout << "\n";
}
}  // namespace
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(9);
  cout << fixed;
  solve();
  return 0;
}
