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 C1017 {
    static class OutputWriter {
        private final PrintWriter writer;
    
        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }
    
        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }
    
        public void print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(array[i]);
            }
        }
    
        public void printLine(int[] array) {
            print(array);
            writer.println();
        }
    
        public void close() {
            writer.close();
        }
    
    }
    static class Pair {
        int value;
        int index;
        Pair(int value, int index) {
            this.value = value;
            this.index = index;
        }
    }
    static class MyComparator implements Comparator<Pair> {
        @Override
        public int compare(Pair p1, Pair p2) {
            if (p1.value != p2.value) return p1.value - p2.value;
            return p1.index - p2.index;
        }
    }
    static int bsearch(int[] arr, int k) {
        int start = 0;
        int end = arr.length - 1;
        while (start < end) {
            int mid = start + (end-start) / 2;
            if (arr[mid] == k) {
                return mid;
            } else if (arr[mid] < k) {
                start = mid+1;
            } else {
                end = mid - 1;
            }
        }
        return start;
    }
    public static void main(String[] args) {
		OutputStream outputStream = System.out;
        OutputWriter out = new OutputWriter(outputStream);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Scanner sc=  new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        if (n==1) arr[0] = 1;
        else if (n==2) {
            arr[0] = 2;
            arr[1] = 1;
        } else if (n ==3) {
            arr[0] = 3;
            arr[1] = 1;
            arr[2] = 2;
        } else {
            int[] temparr = new int[320];
            for (int i=1; i<=320; i++) {
                temparr[i-1] = i*i;
            }
            //for (int i=0; i<=10; i++) System.out.println(temparr[i]);
            int index = bsearch(temparr, n);
            //System.out.println(index);
            Stack<Integer> stack = new Stack<>();
            if (temparr[index] == n) {
                int x = (int)Math.sqrt(n);
                //System.out.println("Yo");
                int idx = 1;
                int times = 1;
                for (int i=0; i<n; i++) {
                    if (times != 1 && times % (int)Math.sqrt(n) == 1) {
                        x = (int)Math.sqrt(n) * (++idx);
                        times = 1;
                    }
                    times++;
                    //System.out.println("x="+x);
                    stack.push(x);
                    x -= 1;
                }
                for (int i=0; i<n; i++) {
                    arr[i] = stack.pop();
                }
            } else {
                //index--;
                if (index>0 && temparr[index]>n) index--;
                int remainingCount = n % (int)Math.sqrt(temparr[index]);
                //System.out.println("Remaining:" + remainingCount);
                int x = (int)Math.sqrt(n);
                //System.out.println("index="+index);
                //System.out.println("Yo");
                int idx = 1;
                int times = 1;
                for (int i=0; i<n-remainingCount; i++) {
                    //System.out.println("Yo"+i);
                    if (times != 1 && times % (int)Math.sqrt(n) == 1) {
                        x = (int)Math.sqrt(n) * (++idx);
                        times = 1;
                    }
                    times++;
                    //System.out.println("x="+x);
                    stack.push(x);
                    x -= 1;
                }
                x = n;
                while (remainingCount>0) {
                    stack.push(x);
                    x--;
                    remainingCount--;
                }
                for (int i=0; i<n; i++) {
                    arr[i] = stack.pop();
                }
            }
        }
		//int n = in.readInt();
        //int[] temparr = IOUtils.readIntArray(in, n);
        //int[] rating = new int[n];
        out.printLine(arr);
        out.close();
    }
}