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 javafx.util.Pair;

import java.io.*;
import java.util.Objects;
import java.util.PriorityQueue;

public class Main {
    public static void main(String[] args) throws IOException {
        PrintWriter out = new PrintWriter(System.out);
        Main mm = new Main();
        mm.problemC(new Input(new BufferedReader(new InputStreamReader(System.in))), out);
        out.close();
    }

    public class Pairs {
        public int exp;
        public int num;

        public Pairs(int first, int second) {
            super();
            this.exp = first;
            this.num = second;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pairs pair = (Pairs) o;
            return exp == pair.exp &&
                    num == pair.num;
        }

        @Override
        public int hashCode() {
            return Objects.hash(exp, num);
        }

        public String toString()
        {
            return "(" + exp + ", " + num + ")";
        }

    }

    static void problemC(Input in, PrintWriter out) throws IOException {
        int n=in.nextInt();
        if(n==1){
            out.println('1');
            return;
        }
        PriorityQueue<Pairs> q=new PriorityQueue<>((q1,q2)->q1.exp==q2.exp?q1.num-q2.num:q1.exp-q2.exp);
        for (int i = 1; i <= n; i++) {
            int k=1,t=i;
            while(t%2==0){
                k*=2;
                t/=2;
            }
            q.add(new Main().new Pairs(k,i));
        }
        for (int i = 0; i < n-2; i++) {
            Pairs p=q.poll();
            out.print(p.exp);
            out.print(' ');
        }
        Pairs p1=q.poll(),p2=q.poll();
        out.print(p1.exp);
        out.print(' ');
        out.println(Integer.max(p1.num,p2.num));
    }

    static void problemB(Input in, PrintWriter out) throws IOException {
        int n=in.nextInt(),m=in.nextInt();
        char[][] c=new char[n+4][];
        c[0]=new char[m+4];
        c[1]=c[0];c[n+2]=c[0];c[n+3]=c[0];
        for (int i = 2; i < n+2; i++) {
            String s="..";
            s=s.concat(in.next());
            s=s.concat("..");
            c[i]=s.toCharArray();
        }
        for (int i = 2; i < n+2; i++) {
            for (int j = 2; j < m+2; j++) {
                if(c[i][j]=='#'){
                    boolean bl=false;
                    for (int di = -1; di <= 1 ; di++) {
                        for (int dj = -1; dj <=1 ; dj++) {
                            if(di!=0||dj!=0){
                                if(c[i+di][j+dj+1]=='#'&&c[i+di][j+dj-1]=='#'&&c[i+di+1][j+dj]=='#'&&c[i+di-1][j+dj]=='#'&&c[i+di+1][j+dj+1]=='#'&&c[i+di+1][j+dj-1]=='#'&&c[i+di-1][j+dj+1]=='#'&&c[i+di-1][j+dj-1]=='#')
                                    bl=true;
                            }
                        }
                    }
                    if(!bl){
                        out.println("NO");
                        return;
                    }
                }
            }

        }
        out.println("YES");
    }


    static void problemA(Input in, PrintWriter out) throws IOException {
        int n=in.nextInt(),L=in.nextInt(),a=in.nextInt(),predt=0,res=0;
        for (int i = 0; i < n; i++) {
            int t=in.nextInt(),l=in.nextInt();
            res+=(t-predt)/a;
            predt=t+l;
        }
        res+=(L-predt)/a;
        out.println(res);
    }



    static class Input {
        BufferedReader in;
        StringBuilder sb = new StringBuilder();

        public Input(BufferedReader in) {
            this.in = in;
        }

        public Input(String s) {
            this.in = new BufferedReader(new StringReader(s));
        }

        public String next() throws IOException {
            sb.setLength(0);
            while (true) {
                int c = in.read();
                if (c == -1) {
                    return null;
                }
                if (" \n\r\t".indexOf(c) == -1) {
                    sb.append((char) c);
                    break;
                }
            }
            while (true) {
                int c = in.read();
                if (c == -1 || " \n\r\t".indexOf(c) != -1) {
                    break;
                }
                sb.append((char) c);
            }
            return sb.toString();
        }

        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());
        }
    }



}
