Problem: Suppose you have two polynomials <image> and <image>. Then polynomial <image> can be uniquely represented in the following way:

<image>

This can be done using [long division](https://en.wikipedia.org/wiki/Polynomial_long_division). Here, <image> denotes the degree of polynomial P(x). <image> is called the remainder of division of polynomial <image> by polynomial <image>, it is also denoted as <image>. 

Since there is a way to divide polynomials with remainder, we can define Euclid's algorithm of finding the greatest common divisor of two polynomials. The algorithm takes two polynomials <image>. If the polynomial <image> is zero, the result is <image>, otherwise the result is the value the algorithm returns for pair <image>. On each step the degree of the second argument decreases, so the algorithm works in finite number of steps. But how large that number could be? You are to answer this question. 

You are given an integer n. You have to build two polynomials with degrees not greater than n, such that their coefficients are integers not exceeding 1 by their absolute value, the leading coefficients (ones with the greatest power of x) are equal to one, and the described Euclid's algorithm performs exactly n steps finding their greatest common divisor. Moreover, the degree of the first polynomial should be greater than the degree of the second. By a step of the algorithm we mean the transition from pair <image> to pair <image>. 

Input

You are given a single integer n (1 ≤ n ≤ 150) — the number of steps of the algorithm you need to reach.

Output

Print two polynomials in the following format.

In the first line print a single integer m (0 ≤ m ≤ n) — the degree of the polynomial. 

In the second line print m + 1 integers between  - 1 and 1 — the coefficients of the polynomial, from constant to leading. 

The degree of the first polynomial should be greater than the degree of the second polynomial, the leading coefficients should be equal to 1. Euclid's algorithm should perform exactly n steps when called using these polynomials.

If there is no answer for the given n, print -1.

If there are multiple answer, print any of them.

Examples

Input

1


Output

1
0 1
0
1


Input

2


Output

2
-1 0 1
1
0 1

Note

In the second example you can print polynomials x2 - 1 and x. The sequence of transitions is

(x2 - 1, x) → (x, - 1) → ( - 1, 0).

There are two steps in it.

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class d {
	static class poly {
		ArrayList<Integer> vals;
		poly(ArrayList<Integer> v) {
			vals = v;
		}
		
		poly mult(poly o) {
			ArrayList<Integer> r = new ArrayList<>();
			for(int i = 0; i < vals.size() + o.vals.size() - 1; i++) {
				r.add(0);
			}
			for(int i = 0; i < vals.size(); i++) {
				for(int j = 0; j < o.vals.size(); j++) {
					r.set(i + j, r.get(i+j) + vals.get(i)*o.vals.get(j));
				}
			}
			return new poly(r);
		}
		
		poly add(poly o) {
			ArrayList<Integer> r = new ArrayList<>();
			for(int i = 0; i < Math.max(vals.size(), o.vals.size()); i++) {
				r.add(0);
			}
			for(int i = 0; i < vals.size(); i++) {
				r.set(i, vals.get(i));
			}
			for(int i = 0; i < o.vals.size(); i++) {
				r.set(i, r.get(i) + o.vals.get(i));
			}
			return new poly(r);
		}
	}

	public static void main(String args[]) throws IOException {
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		//BEGIN HERE
		int n = in.nextInt();
		ArrayList<Integer> ra = new ArrayList<>();
		ra.add(0);
		ArrayList<Integer> da = new ArrayList<>();
		da.add(1);
		poly r = new poly(ra);
		poly d = new poly(da);
		ArrayList<Integer> apx = new ArrayList<>();
		apx.add(0);
		apx.add(1);
		ArrayList<Integer> anx = new ArrayList<>();
		anx.add(0);
		anx.add(-1);
		
		poly nx = new poly(anx);
		poly px = new poly(apx);
		
		for(int i = 0; i < n; i++) {
			poly t = px.mult(d);
			poly s = t.add(r);
			boolean pos = true;
			for(int v : s.vals) {
				if(v > 1 || v < -1) {
					pos = false;
				}
			}
			if(pos) {
				r = d;
				d = s;
				continue;
			}
			
			t = nx.mult(d);
			s = t.add(r);
			for(int v : s.vals) {
				if(v > 1 || v < 1) {
					pos = false;
				}
			}
			assert(pos);
			r = d;
			d = s;
		}
		ArrayList<Integer> n1 = new ArrayList<>();
		n1.add(-1);
		poly nego = new poly(n1);
		if(r.vals.get(r.vals.size()-1) == -1) {
			r = r.mult(nego);
		}
		if(d.vals.get(d.vals.size()-1) == -1) {
			d = d.mult(nego);
		}
		out.println(d.vals.size()-1);
		for(int v : d.vals) {
			out.print(v + " ");
		} out.println();
		out.println(r.vals.size()-1);
		for(int v : r.vals) {
			out.print(v + " ");
		}
		out.close();
	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream i) {
			br = new BufferedReader(new InputStreamReader(i));
			st = null;
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			if (st == null) {
				st = new StringTokenizer(br.readLine());
			}
			String line = st.nextToken("\n");
			st = null;
			return line;
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
	}

	public static class combinatorics {
		static long modInv(long a, long b) {
			return 1 < a ? b - modInv(b % a, a) * b / a : 1;
		}

		static long factorial[], mod;

		combinatorics(int n, long MOD) {
			mod = MOD;
			factorial = new long[n + 1];
			factorial[0] = 1;
			for (int i = 1; i <= n; i++) {
				factorial[i] = i * factorial[i - 1];
				factorial[i] %= mod;
			}
		}

		static long nCr(int n, int r) {
			if (r > n)
				return 0;
			return (factorial[n] * modInv((factorial[n - r] * factorial[r]) % mod, mod)) % mod;
		}
	}
//
//	static int mod = 7340033;
//	static int root = 5;
//	static int root_1 = 4404020;
//	static  int root_pw = 1<<20;
//	 
//	void fft (ArrayList<Integer> a, boolean invert) {
//		int n = (int) a.size();
//	 
//		for (int i=1, j=0; i<n; ++i) {
//			int bit = n >> 1;
//			for (; j>=bit; bit>>=1)
//				j -= bit;
//			j += bit;
//			if (i < j)
//			{
//				int temp = a.get(i);
//				a.get(i) = a.get(j);
//				a.get(j) = temp;
//			}
//		}
//	 
//		for (int len=2; len<=n; len<<=1) {
//			int wlen = invert ? root_1 : root;
//			for (int i=len; i<root_pw; i<<=1)
//				wlen = int (wlen * 1ll * wlen % mod);
//			for (int i=0; i<n; i+=len) {
//				int w = 1;
//				for (int j=0; j<len/2; ++j) {
//					int u = a[i+j],  v = int (a[i+j+len/2] * 1ll * w % mod);
//					a[i+j] = u+v < mod ? u+v : u+v-mod;
//					a[i+j+len/2] = u-v >= 0 ? u-v : u-v+mod;
//					w = int (w * 1ll * wlen % mod);
//				}
//			}
//		}
//		if (invert) {
//			int nrev = reverse (n, mod);
//			for (int i=0; i<n; ++i)
//				a[i] = int (a[i] * 1ll * nrev % mod);
//		}
//	}
}