#include <bits/stdc++.h>
using namespace std;
const int N = 3e6 + 6;
bool can(vector<int> a, vector<int> b) {
  int zb = b.size();
  int za = a.size();
  if (za != zb + 1) return false;
  int pos = 0;
  int neg = 0;
  for (int i = 1; i < zb; i++) {
    if (b[i] == 0) continue;
    if (a[i - 1] == 0) continue;
    if (b[i] == a[i - 1]) pos++;
    if (b[i] == -a[i - 1]) neg++;
  }
  if (pos > 0 and neg > 0)
    return false;
  else
    return true;
}
int get(vector<int> a, vector<int> b) {
  int zb = b.size();
  int pos = 0;
  int neg = 0;
  for (int i = 1; i < zb; i++) {
    if (b[i] == 0) continue;
    if (a[i - 1] == 0) continue;
    if (b[i] == a[i - 1]) pos++;
    if (b[i] == -a[i - 1]) neg++;
  }
  if (pos)
    return -1;
  else
    return 1;
}
vector<int> mul(vector<int> a, vector<int> b) {
  vector<int> ret;
  int sign = get(a, b);
  int za = a.size();
  int zb = b.size();
  ret.resize(za + 1);
  for (int i = 0; i < (int)ret.size(); i++) ret[i] = 0;
  for (int i = 0; i < zb; i++) {
    ret[i] = b[i];
  }
  for (int i = 0; i < za; i++) {
    ret[i + 1] += sign * a[i];
  }
  for (int i = 0; i < za + 1; i++) {
    if (abs(ret[i]) >= 2) assert(false);
  }
  return ret;
}
void solve() {
  int n;
  cin >> n;
  vector<int> a, b;
  a = {0, 1};
  b = {1};
  for (int i = 1; i < n; i++) {
    if (!can(a, b)) {
      cout << -1 << endl;
      return;
    }
    vector<int> trt = mul(a, b);
    b = a;
    a = trt;
  }
  int sa = 1;
  if (a.back() < 0) {
    sa = -1;
  }
  int sb = 1;
  if (b.back() < 0) sb = -1;
  cout << (int)a.size() - 1 << endl;
  for (int x : a) cout << sa * x << " ";
  cout << endl;
  cout << (int)b.size() - 1 << endl;
  for (int x : b) cout << sb * x << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
