#include <bits/stdc++.h>
using namespace std;
long long n, m, a[1008], b[1008];
int k, tot;
long long p[1008];
struct Tmatrix {
  bool num[55][55];
  void clear() { memset(num, 0, sizeof(num)); }
  void unit() {
    clear();
    for (int i = 1; i <= k; i++) num[i][i] = 1;
  }
  Tmatrix operator*(const Tmatrix &t) {
    Tmatrix c;
    for (int i = 1; i <= k; i++)
      for (int j = 1; j <= k; j++) {
        int x = 0;
        for (int l = 1; l <= k; l++) x += num[i][l] * t.num[l][j];
        c.num[i][j] = x & 1;
      }
    return c;
  }
} tmp;
struct Tprogram {
  void open() {
    freopen("1.in", "r", stdin);
    freopen("1.out", "w", stdout);
  }
  void close() {}
  void init() {
    scanf("%d", &k);
    n = (1LL << k) - 1;
    m = n;
    int x = sqrt(n);
    for (int i = 2; i <= x; i++) {
      if ((long long)i * i > n) break;
      if (n % i == 0) {
        while (n % i == 0) n /= i;
        p[++tot] = i;
      }
    }
    if (n != 1) p[++tot] = n;
  }
  bool get(Tmatrix tmp, long long n) {
    Tmatrix ans;
    ans.unit();
    while (n) {
      if (n & 1) ans = ans * tmp;
      tmp = tmp * tmp;
      n >>= 1;
    }
    for (int i = 1; i <= k; i++) b[i] = 0;
    for (int j = 1; j <= k; j++)
      for (int i = 1; i <= k; i++) b[j] += a[i] * ans.num[i][j];
    for (int i = 1; i <= k; i++)
      if ((b[i] & 1) != a[i]) return 0;
    return 1;
  }
  bool work() {
    tmp.clear();
    for (int i = 2; i <= k; i++) tmp.num[i][i - 1] = 1;
    tmp.num[1][k] = 1;
    for (int i = 2; i <= k; i++) tmp.num[i][k] = rand() % 2;
    for (int i = 1; i <= k; i++) a[i] = rand() % 2;
    if (get(tmp, m)) {
      for (int i = 1; i <= tot; i++)
        if (get(tmp, m / p[i])) return 0;
      return 1;
    }
    return 0;
  }
} Program;
int main() {
  srand(time(0));
  Program.init();
  while (!Program.work())
    ;
  for (int i = k; i >= 1; i--) printf("%d ", tmp.num[i][k]);
  printf("\n");
  for (int i = 1; i <= k; i++) printf("%d ", a[i]);
  printf("\n");
  return 0;
}
