#include <bits/stdc++.h>
using namespace std;
template <class T>
void dbs(string str, T t) {
  cerr << str << " : " << t << "\n";
}
template <class T, class... S>
void dbs(string str, T t, S... s) {
  int idx = str.find(',');
  cerr << str.substr(0, idx) << " : " << t << ",";
  dbs(str.substr(idx + 1), s...);
}
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class S, class T>
ostream& operator<<(ostream& os, const map<S, T>& p) {
  os << "[ ";
  for (auto& it : p) os << it << " ";
  return os << "]";
}
template <class T>
void prc(T a, T b) {
  cerr << "[";
  for (T i = a; i != b; ++i) {
    if (i != a) cerr << ", ";
    cerr << *i;
  }
  cerr << "]\n";
}
bitset<1000> poly1;
bitset<1000> poly2;
bitset<1000> shift(bitset<1000> p1) {
  bitset<1000> res;
  for (int i = (int)(0); i <= (int)(998); i++) {
    res[i + 1] = p1[i];
  }
  return res;
}
int main() {
  poly1.set(0);
  poly2.set(1);
  int n;
  cin >> n;
  for (int i = (int)(2); i <= (int)(n); i++) {
    bitset<1000> cpPoly2 = poly2;
    poly2 = shift(poly2);
    bitset<1000> res = poly2 ^ poly1;
    poly1 = cpPoly2;
    poly2 = res;
  }
  vector<int> answer1, answer2;
  for (int i = (int)(0); i <= (int)(999); i++) {
    answer1.push_back(poly1[i]);
  }
  for (int i = (int)(0); i <= (int)(999); i++) {
    answer2.push_back(poly2[i]);
  }
  for (int i = (int)(999); i >= (int)(0); --i) {
    if (answer1[i]) {
      break;
    }
    answer1.pop_back();
  }
  for (int i = (int)(999); i >= (int)(0); --i) {
    if (answer2[i]) break;
    answer2.pop_back();
  }
  swap(answer1, answer2);
  cout << int(answer1.size()) - 1 << "\n";
  for (auto num : answer1) {
    cout << num << " ";
  }
  cout << "\n";
  cout << int(answer2.size()) - 1 << "\n";
  for (auto num : answer2) {
    cout << num << " ";
  }
  cout << "\n";
  return 0;
}
