#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
vector<int> v1;
vector<int> v2;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  v1.push_back(1);
  v2.push_back(0);
  for (int i = 0; i < n; ++i) {
    vector<int> v3(v2);
    v2 = v1;
    v1.push_back(0);
    for (int i = 0; i < v3.size(); ++i) {
      v1[v1.size() - i - 1] += v3[v3.size() - i - 1];
      if (v1[v1.size() - i - 1] == 2) v1[v1.size() - i - 1] = 0;
    }
  }
  cout << v1.size() - 1 << endl;
  for (int i = v1.size() - 1; i >= 0; i--) {
    cout << v1[i] << ' ';
  }
  cout << endl;
  cout << v2.size() - 1 << endl;
  for (int i = v2.size() - 1; i >= 0; i--) {
    cout << v2[i] << ' ';
  }
  cout << endl;
  return 0;
}
