#include <bits/stdc++.h>
using namespace std;
int main() {
  srand(time(nullptr));
  int n;
  scanf("%d", &n);
  vector<vector<int>> f;
  f.push_back({1});
  f.push_back({0, 1});
  for (int i = 2; i <= n; i++) {
    f.push_back({});
    f.back().push_back(f[i - 2][0]);
    for (int j = 1; j <= i - 2; j++)
      f.back().push_back(f[i - 2][j] + f[i - 1][j - 1]);
    f.back().push_back(f[i - 1][i - 2]);
    f.back().push_back(f[i - 1][i - 1]);
    for (int &x : f.back()) x = x % 2;
  }
  printf("%d\n", n);
  for (int a : f[n]) printf("%d ", a);
  printf("\n%d\n", n - 1);
  for (int a : f[n - 1]) printf("%d ", a);
  return 0;
}
