#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int i, j;
  vector<int> vec1, vec2, vec3;
  vec1.push_back(0);
  vec2.push_back(1);
  vec1.push_back(1);
  n--;
  for (j = 0; j < n; j++) {
    vec3.push_back(0);
    for (i = 0; i < vec1.size(); i++) {
      vec3.push_back(vec1[i] % 2);
    }
    for (i = 0; i < vec2.size(); i++) {
      vec3[i] += vec2[i];
      vec3[i] %= 2;
    }
    vec2.clear();
    for (i = 0; i < vec1.size(); i++) {
      vec2.push_back(vec1[i] % 2);
    }
    vec1.clear();
    for (i = 0; i < vec3.size(); i++) {
      vec1.push_back(vec3[i] % 2);
    }
    vec3.clear();
  }
  cout << vec1.size() - 1 << endl;
  for (i = 0; i < vec1.size(); i++) {
    cout << vec1[i] << " ";
  }
  cout << endl;
  cout << vec2.size() - 1 << endl;
  for (i = 0; i < vec2.size(); i++) {
    cout << vec2[i] << " ";
  }
  return 0;
}
