Let's call the following process a transformation of a sequence of length n.

If the sequence is empty, the process ends. Otherwise, append the [greatest common divisor](https://en.wikipedia.org/wiki/Greatest_common_divisor) (GCD) of all the elements of the sequence to the result and remove one arbitrary element from the sequence. Thus, when the process ends, we have a sequence of n integers: the greatest common divisors of all the elements in the sequence before each deletion.

You are given an integer sequence 1, 2, ..., n. Find the lexicographically maximum result of its transformation.

A sequence a_1, a_2, …, a_n is lexicographically larger than a sequence b_1, b_2, …, b_n, if there is an index i such that a_j = b_j for all j < i, and a_i > b_i.

Input

The first and only line of input contains one integer n (1≤ n≤ 10^6).

Output

Output n integers — the lexicographically maximum result of the transformation.

Examples

Input

3


Output

1 1 3 

Input

2


Output

1 2 

Input

1


Output

1 

Note

In the first sample the answer may be achieved this way:

  * Append GCD(1, 2, 3) = 1, remove 2. 
  * Append GCD(1, 3) = 1, remove 1. 
  * Append GCD(3) = 3, remove 3. 



We get the sequence [1, 1, 3] as the result.
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import java.util.TreeSet;



public final class CF_514_C {

	static boolean verb=true;
	static void log(Object X){if (verb) System.err.println(X);}
	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X,int L){if (verb) {for (int i=0;i<L;i++) System.err.print(X[i]+" ");System.err.println("");}}
	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}

	static void logWln(Object X){if (verb) System.err.print(X);}
	static void info(Object o){	System.out.println(o);}
	static void output(Object o){outputWln(""+o+"\n");	}
	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}



	// Global vars
	static BufferedWriter out;
	static InputReader reader;

	static char find(int i,int j,String[] map,int n,int m){
		if (i<0 ||i>=n ||j<0||j>=m)
			return '@';
		return map[i].charAt(j);
		
	}

static int pgcd(int a,int b){
	if (a<b)
		return pgcd(b,a);
	while (b>0){
		int c=b;
		b=a%b;
		a=c;
		
	}
	return a;
	
}

static  ArrayList<ArrayList<Integer>> generatePermutations(ArrayList<Integer> items){
	ArrayList<ArrayList<Integer>> globalRes=new ArrayList<ArrayList<Integer>>();
	if (items.size()>1) {
		for (Integer item:items){
		
		ArrayList<Integer> itemsTmp=new ArrayList<Integer>(items);
		itemsTmp.remove(item);
		ArrayList<ArrayList<Integer>> res=generatePermutations(itemsTmp);
		for (ArrayList<Integer> list:res){
			list.add(item);
		}
		globalRes.addAll(res);
		}
	}
	else {
		Integer item=items.get(0);
		ArrayList<Integer> list=new ArrayList<Integer>();
			list.add(item);
			globalRes.add(list);
	}
	
	return globalRes;
}

	static void solveSlow(int n){
		
		ArrayList<Integer> items=new ArrayList<Integer>();
		for (int u=1;u<=n;u++)
			items.add(u);
		ArrayList<ArrayList<Integer>>world= generatePermutations(items);
		int[] best=new int[n];
		Arrays.fill(best,1);
		for (ArrayList<Integer> list:world){
			HashSet<Integer> hs=new HashSet<Integer>();
			for (int i=1;i<=n;i++)
				hs.add(i);
			int[] res=new int[n];
			int st=0;
			
			for (int x:list){
				int p=0;
				for (int u:hs){
					p=pgcd(u,p);
				}
				res[st++]=p;
				hs.remove(x);
			}
			lp:for (int i=0;i<n;i++){
				if (res[i]<best[i]){
					break lp;
				}
				if (res[i]>best[i]){
					best=res;
					break lp;
				}
			}
		}
		log(best);
	}
	
	static int[] solve(int n){
		if (n==3)
			return new int[]{1,1,3};
		if (n==1)
			return new int[]{1};
		if (n==2)
			return new int[]{1,2};
		
		int[] ans=new int[n];
		
		
		int odd=(n+1)/2;
		String r="";
		for (int i=0;i<odd;i++)
			ans[i]=1;
		int rem=n-odd;
		int[] tmp=solve(rem);
		//log("tmp.len:"+tmp.length);
		//log("rem:"+rem+" odd:"+odd);
		for (int i=odd;i<n;i++){
			//log("i:"+i);
			ans[i]=tmp[i-odd]*2;
		}
		
		return ans;
		
	}
	

	
	static void process() throws Exception {


		out = new BufferedWriter(new OutputStreamWriter(System.out));
		reader=new InputReader(System.in);

		//for (int i=1;i<10;i++)
		//	solveSlow(i);
		
		int n=reader.readInt();
		
		int[] ans=solve(n);
		for (int i=0;i<n;i++)
			outputWln(ans[i]+" ");
		output("");
		
		
		
		
		try {
			out.close();
		}
		catch (Exception EX){}


	}


	public static void main(String[] args) throws Exception {
		process();

	}

	static final class InputReader {
		private final InputStream stream;
		private final byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		private int read() throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read(buf);
				if (numChars <= 0) {
					return -1;
				}
			}
			return buf[curChar++];
		}


		public final String readString() throws IOException {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res=new StringBuilder();
			do {
				res.append((char)c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public final int readInt() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		public final long readLong() throws IOException {
			int c = read();
			boolean neg=false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d=(char)c;
			//log("d:"+d);
			if (d=='-') {
				neg=true;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			//log("res:"+res);
			if (neg)
				return -res;
			return res;

		}




		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}


}