#include <bits/stdc++.h>
using namespace std;
const int MAX_K = 50;
vector<int> primes;
vector<long long> prime_divisors;
int PRIMES_COUNT, k;
int A[MAX_K][MAX_K], E[MAX_K][MAX_K], T[MAX_K][MAX_K], W[MAX_K][MAX_K];
inline void precalc() {
  for (int i = 0; i < MAX_K; ++i) {
    E[i][i] = 1;
  }
  const int SIEVE_SIZE = (int)1e6;
  bitset<SIEVE_SIZE + 1> sieve;
  primes.push_back(2);
  for (int i = 3; i * i <= SIEVE_SIZE; i += 2) {
    if (!sieve[i]) {
      primes.push_back(i);
      for (int j = i * i; j <= SIEVE_SIZE; j += i) {
        sieve.set(j);
      }
    }
  }
  for (int i = 1001; i <= SIEVE_SIZE; i += 2) {
    if (!sieve[i]) {
      primes.push_back(i);
    }
  }
  PRIMES_COUNT = primes.size();
  srand(time(NULL));
}
inline void factor(long long period) {
  prime_divisors.clear();
  long long initial = period;
  for (int i = 0; i < PRIMES_COUNT; ++i) {
    if (period % primes[i]) {
      continue;
    }
    prime_divisors.push_back(primes[i]);
    while (period % primes[i] == 0) {
      period /= primes[i];
    }
  }
  if (period > 1) {
    prime_divisors.push_back(period);
  }
}
inline void power(long long what) {
  memcpy(W, A, sizeof A);
  memcpy(T, E, sizeof E);
  int helper[MAX_K][MAX_K];
  for (; what != 0; what >>= 1) {
    if (what & 1) {
      memcpy(helper, T, sizeof T);
      memset(T, 0, sizeof T);
      for (int i = 0; i < k; ++i) {
        for (int j = 0; j < k; ++j) {
          for (int t = 0; t < k; ++t) {
            T[i][j] ^= helper[i][t] & W[t][j];
          }
        }
      }
    }
    memcpy(helper, W, sizeof W);
    memset(W, 0, sizeof W);
    for (int i = 0; i < k; ++i) {
      for (int j = 0; j < k; ++j) {
        for (int t = 0; t < k; ++t) {
          W[i][j] ^= helper[i][t] & helper[t][j];
        }
      }
    }
  }
}
inline bool check(long long period) {
  power(period);
  bool ok = true;
  for (int i = 0; i < k; ++i) {
    for (int j = 0; j < k; ++j) {
      ok &= T[i][j] == E[i][j];
    }
  }
  if (!ok) return false;
  for (int i = 0; i < prime_divisors.size(); ++i) {
    power(period / prime_divisors[i]);
    bool now = true;
    for (int i = 0; i < k; ++i) {
      for (int j = 0; j < k; ++j) {
        now &= T[i][j] == E[i][j];
      }
    }
    if (now) return false;
  }
  return true;
}
inline vector<int> solve() {
  long long period = -1;
  period += 1LL << k;
  vector<int> rec(k);
  factor(period);
  do {
    memset(A, 0, sizeof A);
    for (int i = 1; i < k; ++i) {
      A[i][i - 1] = 1;
    }
    long long r = 0, rrr;
    do {
      rrr = rand();
      rrr <<= 32;
      rrr |= rand();
      for (int i = 0; i < k; ++i) r |= rrr & (1LL << i);
    } while (!r);
    for (int i = 0; i < k; ++i) {
      A[i][k - 1] = rec[k - 1 - i] = (r >> i) & 1;
    }
  } while (!check(period));
  return rec;
}
int main() {
  precalc();
  ios_base::sync_with_stdio(false);
  cin >> k;
  vector<int> reccurence = solve();
  for (int i = 0; i < k; ++i) {
    cout << reccurence[i] << ' ';
  }
  cout << '\n';
  for (int i = 0; i + 1 < k; ++i) {
    cout << "0 ";
  }
  cout << "1\n";
  return 0;
}
