Mrs. Smith is trying to contact her husband, John Smith, but she forgot the secret phone number!

The only thing Mrs. Smith remembered was that any permutation of n can be a secret phone number. Only those permutations that minimize secret value might be the phone of her husband.

The sequence of n integers is called a permutation if it contains all integers from 1 to n exactly once.

The secret value of a phone number is defined as the sum of the length of the longest increasing subsequence (LIS) and length of the longest decreasing subsequence (LDS). 

A subsequence a_{i_1}, a_{i_2}, …, a_{i_k} where 1≤ i_1 < i_2 < … < i_k≤ n is called increasing if a_{i_1} < a_{i_2} < a_{i_3} < … < a_{i_k}. If a_{i_1} > a_{i_2} > a_{i_3} > … > a_{i_k}, a subsequence is called decreasing. An increasing/decreasing subsequence is called longest if it has maximum length among all increasing/decreasing subsequences.

For example, if there is a permutation [6, 4, 1, 7, 2, 3, 5], LIS of this permutation will be [1, 2, 3, 5], so the length of LIS is equal to 4. LDS can be [6, 4, 1], [6, 4, 2], or [6, 4, 3], so the length of LDS is 3.

Note, the lengths of LIS and LDS can be different.

So please help Mrs. Smith to find a permutation that gives a minimum sum of lengths of LIS and LDS.

Input

The only line contains one integer n (1 ≤ n ≤ 10^5) — the length of permutation that you need to build.

Output

Print a permutation that gives a minimum sum of lengths of LIS and LDS. 

If there are multiple answers, print any.

Examples

Input

4


Output

3 4 1 2


Input

2


Output

2 1

Note

In the first sample, you can build a permutation [3, 4, 1, 2]. LIS is [3, 4] (or [1, 2]), so the length of LIS is equal to 2. LDS can be ony of [3, 1], [4, 2], [3, 2], or [4, 1]. The length of LDS is also equal to 2. The sum is equal to 4. Note that [3, 4, 1, 2] is not the only permutation that is valid.

In the second sample, you can build a permutation [2, 1]. LIS is [1] (or [2]), so the length of LIS is equal to 1. LDS is [2, 1], so the length of LDS is equal to 2. The sum is equal to 3. Note that permutation [1, 2] is also valid.
import java.io.*;
import java.util.*;


public class Main {
    private final static long mod = 1000000007;


    private static void printArr(char arr[][]) {
        int i, j, n = arr.length, m = arr[0].length;
        for (i = 0; i < n; i++) {
            for (j = 0; j < m; j++) {
                System.out.print(arr[i][j]);
            }
            System.out.println();
        }
    }


    private static long power(long x, long y, long m) {
        long temp;
        if (y == 0)
            return 1;
        temp = power(x, y / 2,m);
        temp = (temp * temp) % m;
        if (y % 2 == 0)
            return temp;
        else
            return ((x % m) * temp) % m;
    }

    private static  long power(long x, long y){
        return power(x,y,mod);
    }

    private static int gcd(int a, int b) {
        if (b == 0) return a;
        return gcd(b, a % b);
    }

    private static int cmp(Pair p, Pair q) {
        return (int)(p.a == q.a ? p.b - q.b : p.a - q.a);
    }

    static int nextPowerOf2(int n) {
        int count = 0;
        if (n > 0 && (n & (n - 1)) == 0)
            return n * 2;

        while (n != 0) {
            n >>= 1;
            count += 1;
        }

        return 1 << count;
    }
    static String isPrime(int n){
        int i;
        for(i=2;i*i<n;i++){
            if(n%i==0)return "Not prime";
        }
        return "Prime";
    }

    private static long[] computeTotient(int n) {
        long phi[] = new long[n + 1];
        for (int i = 1; i <= n; i++)
            phi[i] = i;
        for (int p = 2; p <= n; p++) {
            if (phi[p] == p) {
                phi[p] = p - 1;
                for (int i = 2 * p; i <= n; i += p) {
                    phi[i] = (phi[i] / p) * (p - 1);
                }
            }
        }
        return phi;
    }

    private static long modInverse(long a, long m) {
        long m0 = m;
        long y = 0, x = 1;
        if (m == 1)
            return 0;
        while (a > 1) {
            long q = a / m;
            long t = m;
            m = a % m;
            a = t;
            t = y;
            y = x - q * y;
            x = t;
        }
        if (x < 0)
            x += m0;
        return x;
    }

    static long sum=0,pa=0;
    private static void dfs(
            List<List<Integer>>gr, PriorityQueue<Integer> mxc, Map<Integer,Integer>cs,int i){
        mxc.add(i);
        for(int j:gr.get(i)){
            PriorityQueue<Integer>mxcc=new PriorityQueue<>(Collections.reverseOrder());
            dfs(gr,mxcc,cs,j);
            mxc.addAll(mxcc);
        }
        for(int j=cs.getOrDefault(i,0);j>0;j--){
            if(mxc.size()>0) {
                sum += mxc.peek();
                mxc.poll();
            }
        }
        if(cs.containsKey(i))cs.remove(i);
    }

    private static void reverse(int arr[], int n, int k) {
        for (int i = 0; i < n; i += k) {
            int left = i;
            int right = Math.min(i + k - 1, n - 1);
            int temp;
            while (left < right) {
                temp = arr[left];
                arr[left++] = arr[right];
                arr[right--] = temp;
            }
        }
    }

    public static void main(String[] args) throws IOException {
        FastReader in = new FastReader();
        FastWriter out = new FastWriter();
        int t, i, j, k, r, l = 0,g, n,ti,m;
        long ans = 0, cur=0, w, mx = -mod, mn = mod,md,d;
        //tc:for (t = in.nextInt(),ti=1; ti <= t; ti++)
        {
            //out.print(String.format("Case #%d: ",ti));
            n=in.nextInt();
            m=(int)Math.sqrt(n-1)+1;
            int a[]=new int[n];
            for(i=0;i<n;i++){
                a[i]=n-i;
            }
            reverse(a,n,m);
            for(i=0;i<n;i++){
                out.print(a[i]+" ");
            }
            out.println();
        }
        in.close();
        out.close();
    }

    private static class Pair {
        long a;
        long b;

        public Pair(long a, long b) {
            this.a = a;
            this.b = b;
        }

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

        @Override
        public int hashCode() {

            return Objects.hash(a, b);
        }
    }

    static class FastReader implements Closeable{
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        private StringTokenizer st;

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] nextIntArr(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        long[] nextLongArr(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }
        int[][] nextIntArr2(int n, int m) {
            int[][] arr = new int[n][m];
            for (int i = 0; i < n; i++) {
                arr[i] = nextIntArr(m);
            }
            return arr;
        }

        long[][] nextLongArr2(int n, int m) {
            long[][] arr = new long[n][m];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLongArr(m);
            }
            return arr;
        }

        @Override
        public void close() throws IOException {
            br.close();
        }
    }

    static class FastWriter implements Closeable{
        BufferedWriter bw;
        List<String> list = new ArrayList<>();
        Set<String> set = new HashSet<>();

        FastWriter() {
            bw = new BufferedWriter(new OutputStreamWriter(System.out));
        }

        <T> void print(T obj) throws IOException {
            bw.write(obj.toString());
            bw.flush();
        }

        void println() throws IOException {
            print("\n");
        }

        <T> void println(T obj) throws IOException {
            print(obj.toString() + "\n");
        }

        <T> void printArrLn(T[] arr) throws IOException {
            for (int i = 0; i < arr.length-1; i++) {
                print(arr[i] + " ");
            }
            println(arr[arr.length-1]);
        }

        <T> void printArr2(T[][] arr) throws IOException {
            for(int j=0;j<arr.length;j++) {
                for (int i = 0; i < arr[j].length - 1; i++) {
                    print(arr[j][i] + " ");
                }
                println(arr[j][arr.length - 1]);
            }
        }

        <T> void printColl(Collection<T> coll) throws IOException {
            for (T e:coll) {
                print(e + " ");
            }
            println();
        }

        void printCharN(char c, int n) throws IOException {
            for (int i = 0; i < n; i++) {
                print(c);
            }
        }

        @Override
        public void close() throws IOException {
            bw.close();
        }
    }


}

