#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
vector<double> mod(vector<double> p1, vector<double> p2) {
  int deg1 = p1.size(), deg2 = p2.size();
  for (int i = deg1 - 1; i >= deg2 - 1; i--) {
    double d = p1[i] / p2.back();
    for (int j = deg2 - 1; j >= 0; j--) p1[i - (deg2 - 1 - j)] -= d * p2[j];
  }
  p1.resize(p2.size() - 1);
  return p1;
}
bool check(vector<double> p1, vector<double> p2) {
  int cnt = 0, deg = p1.size();
  for (int i = 0; i < deg - 1; i++) {
    swap(p1, p2);
    p2 = mod(p2, p1);
    cnt++;
    if (abs(p2.back()) < eps) break;
  }
  if (cnt == deg - 1) return 1;
  return 0;
}
int main() {
  srand(time(NULL));
  int n;
  cin >> n;
  vector<int> p1, p2;
  while (true) {
    p1.clear();
    p2.clear();
    for (int i = 0; i <= n; i++) p1.push_back(rand() % 3 - 1);
    for (int i = 0; i <= n - 1; i++) p2.push_back(rand() % 3 - 1);
    p1[p1.size() - 1] = 1;
    p2[p2.size() - 1] = 1;
    vector<double> dp1, dp2;
    for (auto i : p1) dp1.push_back(i);
    for (auto i : p2) dp2.push_back(i);
    if (check(dp1, dp2)) {
      cout << n << "\n";
      for (int j : p1) cout << j << " ";
      cout << "\n";
      cout << n - 1 << "\n";
      for (int j : p2) cout << j << " ";
      cout << "\n";
      return 0;
    }
  }
  cout << -1 << "\n";
  return 0;
}
