#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& a) {
  in >> a.first >> a.second;
  return in;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& out, pair<T1, T2> a) {
  out << a.first << " " << a.second;
  return out;
}
template <typename T, typename T1>
T maxs(T& a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T mins(T& a, T1 b) {
  if (b < a) a = b;
  return a;
}
long long solve() {
  long long n;
  cin >> n;
  vector<vector<long long>> vec(n + 1, vector<long long>(n + 1));
  vec[0][0] = 1;
  vec[1][1] = 1;
  long long cur = 1;
  while (cur != n) {
    long long j = cur;
    long long i = cur - 1;
    cur++;
    vec[cur] = vec[i];
    for (long long k = 1; k <= n; k++) {
      vec[cur][k] ^= vec[j][k - 1];
    }
  }
  cout << n << "\n";
  for (auto i : vec[n]) cout << i << " ";
  cout << "\n";
  cout << n - 1 << "\n";
  vec[n - 1].pop_back();
  for (auto i : vec[n - 1]) cout << i << " ";
  cout << "\n";
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
