#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
vector<int> f, g;
void fdo(int k) {
  if (k == 0) return;
  vector<int> temp = f;
  f.clear();
  f.push_back(0);
  for (auto it : temp) f.push_back(it);
  bool flag = true;
  int ch = 0;
  for (int i = 0; i < g.size(); i++) {
    if (abs(f[i] + g[i]) > 1) flag = false;
  }
  for (int i = 0; i < g.size(); i++) {
    if (flag) {
      f[i] = f[i] + g[i];
    } else {
      f[i] = f[i] - g[i];
    }
  }
  g = temp;
  for (int i = 0; i < f.size(); i++) {
    assert(abs(f[i]) < 2);
  }
  assert(f[f.size() - 1] == 1);
  assert(g[g.size() - 1] == 1);
  fdo(k - 1);
}
int main() {
  int n;
  scanf("%d", &n);
  f.push_back(0);
  f.push_back(1);
  if (n != 1)
    g.push_back(-1);
  else
    g.push_back(1);
  fdo(n - 1);
  cout << f.size() - 1 << endl;
  for (auto it : f) cout << it << " ";
  cout << endl;
  cout << g.size() - 1 << endl;
  for (auto it : g) cout << it << " ";
  return 0;
}
