Problem: A sequence a0, a1, ... is called a recurrent binary sequence, if each term ai (i = 0, 1, ...) is equal to 0 or 1 and there exist coefficients <image> such that 

an = c1·an - 1 + c2·an - 2 + ... + ck·an - k (mod 2),  for all n ≥ k. Assume that not all of ci are zeros.

Note that such a sequence can be uniquely recovered from any k-tuple {as, as + 1, ..., as + k - 1} and so it is periodic. Moreover, if a k-tuple contains only zeros, then the sequence contains only zeros, so this case is not very interesting. Otherwise the minimal period of the sequence is not greater than 2k - 1, as k-tuple determines next element, and there are 2k - 1 non-zero k-tuples. Let us call a sequence long if its minimal period is exactly 2k - 1. Your task is to find a long sequence for a given k, if there is any.

Input

Input contains a single integer k (2 ≤ k ≤ 50).

Output

If there is no long sequence for a given k, output "-1" (without quotes). Otherwise the first line of the output should contain k integer numbers: c1, c2, ..., ck (coefficients). The second line should contain first k elements of the sequence: a0, a1, ..., ak - 1. All of them (elements and coefficients) should be equal to 0 or 1, and at least one ci has to be equal to 1.

If there are several solutions, output any.

Examples

Input

2


Output

1 1
1 0


Input

3


Output

0 1 1
1 1 1

Note

1. In the first sample: c1 = 1, c2 = 1, so an = an - 1 + an - 2 (mod 2). Thus the sequence will be:

<image>

so its period equals 3 = 22 - 1.

2. In the second sample: c1 = 0, c2 = 1, c3 = 1, so an = an - 2 + an - 3 (mod 2). Thus our sequence is:

<image>

and its period equals 7 = 23 - 1.

Periods are colored.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int maxk = 51;
struct matrix {
  bool e[maxk][maxk];
  int sz;
  void print() {
    for (int i = 0, _n = (sz); i < _n; i++) {
      for (int j = 0, _n = (sz); j < _n; j++) {
        printf("%d", e[i][j]);
      }
      printf("\n");
    }
    printf("\n");
  }
};
matrix operator*(const matrix &A, const matrix &B) {
  matrix ret;
  memset(&ret, 0, sizeof(ret));
  ret.sz = A.sz;
  for (int i = 0, _n = (A.sz); i < _n; i++)
    for (int k = 0, _n = (A.sz); k < _n; k++)
      if (A.e[i][k])
        for (int j = 0, _n = (A.sz); j < _n; j++) ret.e[i][j] ^= B.e[k][j];
  return ret;
}
matrix one;
matrix pow2(matrix M, long long deg) {
  matrix ret;
  memset(&ret, 0, sizeof(ret));
  for (int i = 0, _n = (M.sz); i < _n; i++) ret.e[i][i] = 1;
  ret.sz = M.sz;
  while (deg) {
    if (deg & 1) ret = ret * M;
    M = M * M;
    deg >>= 1;
  }
  return ret;
}
long long my_rand() {
  long long ret = 0;
  for (int i = 0, _n = (4); i < _n; i++) ret = (ret << 15) + rand() % (1 << 15);
  return ret;
}
vector<long long> prime_div;
int check_one(const matrix &tmp) {
  bool zero = 1;
  for (int i = 0, _n = (tmp.sz); i < _n; i++)
    for (int j = 0, _n = (tmp.sz); j < _n; j++)
      if (tmp.e[i][j]) zero = 0;
  if (zero) return 0;
  for (int i = 0, _n = (tmp.sz); i < _n; i++)
    for (int j = 0, _n = (tmp.sz); j < _n; j++)
      if (tmp.e[i][j] != (i == j)) return -1;
  return 1;
}
bool check(long long c, int k) {
  matrix cM;
  memset(&cM, 0, sizeof(cM));
  cM.sz = k;
  for (int i = 0, _n = (k - 1); i < _n; i++) cM.e[i][i + 1] = 1;
  for (int i = 0, _n = (k); i < _n; i++)
    cM.e[k - 1][k - i - 1] = ((c & (1ll << i)) > 0);
  matrix tmp = pow2(cM, (1ll << k) - 1);
  long long m = (1ll << k) - 1;
  if (check_one(tmp) == 1) {
    for (int i = 0, _n = (prime_div.size()); i < _n; i++) {
      tmp = pow2(cM, m / prime_div[i]);
      if (check_one(tmp) != -1) return 0;
    }
    return 1;
  }
  return 0;
}
long long find_ans(int k) {
  prime_div.clear();
  long long m = (1ll << k) - 1;
  for (long long q = 2; q * q <= m; q++) {
    if (m % q == 0) {
      while (m % q == 0) m /= q;
      prime_div.push_back(q);
    }
  }
  if (m > 1) prime_div.push_back(m);
  one.sz = k;
  long long c = 0;
  for (c = (1ll << (k - 1)); !check(c, k); c++)
    ;
  return c;
}
void generate_ans() {
  memset(&one, 0, sizeof(one));
  for (int k = 0, _n = (50); k < _n; k++) one.e[k][k] = 1;
  for (int k = 2, _b = (50); k <= _b; k++) {
    long long c = find_ans(k);
    cout << c << "ll, " << endl;
    fprintf(stderr, "%d\n", k);
  }
}
long long const_ans[51] = {
    0ll,
    0ll,
    3ll,
    5ll,
    9ll,
    18ll,
    33ll,
    65ll,
    142ll,
    264ll,
    516ll,
    1026ll,
    2089ll,
    4109ll,
    8213ll,
    16385ll,
    32790ll,
    65540ll,
    131091ll,
    262163ll,
    524292ll,
    1048578ll,
    2097153ll,
    4194320ll,
    8388621ll,
    16777220ll,
    33554467ll,
    67108883ll,
    134217732ll,
    268435458ll,
    536870953ll,
    1073741828ll,
    2147483735ll,
    4294967337ll,
    8589934707ll,
    17179869186ll,
    34359738427ll,
    68719476767ll,
    137438953521ll,
    274877906952ll,
    549755813916ll,
    1099511627780ll,
    2199023255583ll,
    4398046511148ll,
    8796093022258ll,
    17592186044429ll,
    35184372088983ll,
    70368744177680ll,
    140737488355419ll,
    281474976710712ll,
    562949953421326ll,
};
int k;
int main() {
  scanf("%d", &k);
  const_ans[k] = find_ans(k);
  for (int i = 0, _n = (k); i < _n; i++) {
    if (i) printf(" ");
    printf("%d", (const_ans[k] & (1ll << i)) > 0);
  }
  printf("\n");
  for (int i = 0, _n = (k - 1); i < _n; i++) printf("0 ");
  printf("1\n");
  return 0;
}