#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios {
  fast_ios() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  };
} fast_ios_;
template <typename T>
void ndarray(vector<T> &vec, int len) {
  vec.resize(len);
}
template <typename T, typename... Args>
void ndarray(vector<T> &vec, int len, Args... args) {
  vec.resize(len);
  for (auto &v : vec) ndarray(v, args...);
}
template <typename T>
bool chmax(T &m, const T q) {
  if (m < q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T>
bool chmin(T &m, const T q) {
  if (m > q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T1, typename T2>
pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) {
  return make_pair(l.first + r.first, l.second + r.second);
}
template <typename T1, typename T2>
pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) {
  return make_pair(l.first - r.first, l.second - r.second);
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (auto v : vec) os << v << ",";
  os << "]";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const deque<T> &vec) {
  os << "deq[";
  for (auto v : vec) os << v << ",";
  os << "]";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &vec) {
  os << "{";
  for (auto v : vec) os << v << ",";
  os << "}";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &vec) {
  os << "{";
  for (auto v : vec) os << v << ",";
  os << "}";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &vec) {
  os << "{";
  for (auto v : vec) os << v << ",";
  os << "}";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_multiset<T> &vec) {
  os << "{";
  for (auto v : vec) os << v << ",";
  os << "}";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &pa) {
  os << "(" << pa.first << "," << pa.second << ")";
  return os;
}
template <typename TK, typename TV>
ostream &operator<<(ostream &os, const map<TK, TV> &mp) {
  os << "{";
  for (auto v : mp) os << v.first << "=>" << v.second << ",";
  os << "}";
  return os;
}
template <typename TK, typename TV>
ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp) {
  os << "{";
  for (auto v : mp) os << v.first << "=>" << v.second << ",";
  os << "}";
  return os;
}
vector<int> prod(vector<int> v1, vector<int> v2) {
  int deg = v1.size() + v2.size() - 2;
  vector<int> ret(deg + 1);
  for (int i = (0), i_end_ = (v1.size()); i < i_end_; i++)
    for (int j = (0), j_end_ = (v2.size()); j < j_end_; j++)
      ret[i + j] += v1[i] * v2[j];
  return ret;
}
int main() {
  int N;
  cin >> N;
  vector<int> a1{0, 1}, a0{1};
  set<int> plus{2, 4, 7, 8, 10, 13, 15};
  for (int i = 2; i <= N; i++) {
    vector<int> a1_nxt = prod(vector<int>{0, 1}, a1);
    for (int i = (0), i_end_ = (a0.size()); i < i_end_; i++) a1_nxt[i] += a0[i];
    bool ok = true;
    for (auto x : a1_nxt)
      if (abs(x) > 1) ok = false;
    if (!ok) {
      a1_nxt = prod(vector<int>{0, 1}, a1);
      for (int i = (0), i_end_ = (a0.size()); i < i_end_; i++)
        a1_nxt[i] -= a0[i];
    }
    a0 = a1;
    a1 = a1_nxt;
  }
  printf("%d\n", int(a1.size()) - 1);
  for (auto x : a1) printf("%d ", x);
  puts("");
  printf("%d\n", int(a0.size()) - 1);
  for (auto x : a0) printf("%d ", x);
  puts("");
}
