#include <bits/stdc++.h>
using namespace std;
pair<vector<int>, vector<int>> help1(int n) {
  vector<int> ans1;
  vector<int> ans2;
  if (n == 1) {
    ans1.push_back(0);
    ans1.push_back(1);
    ans2.push_back(1);
    return {ans1, ans2};
  }
  pair<vector<int>, vector<int>> rec = help1(n - 1);
  ans1 = rec.first;
  ans2 = rec.second;
  vector<int> help = ans1;
  help.push_back(0);
  for (int i = help.size() - 1; i > 0; i--) {
    help[i] = help[i - 1];
  }
  help[0] = 0;
  for (int i = 0; i < help.size() - 2; i++) {
    help[i] = (help[i] + ans2[i]) % 3;
  }
  return {help, ans1};
}
int main() {
  int n;
  cin >> n;
  pair<vector<int>, vector<int>> ans = help1(n);
  cout << ans.first.size() - 1 << endl;
  for (int i = 0; i < ans.first.size(); i++) {
    if (ans.first[i] != 2) {
      cout << ans.first[i] << ' ';
    } else {
      cout << -1 << ' ';
    }
  }
  cout << endl;
  cout << ans.second.size() - 1 << endl;
  for (int i = 0; i < ans.second.size(); i++) {
    if (ans.second[i] != 2) {
      cout << ans.second[i] << ' ';
    } else {
      cout << -1 << ' ';
    }
  }
  cout << endl;
}
