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.util.Arrays;
import java.util.Scanner;

public class c {
	static Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		int N = in.nextInt();
		
		// ugh this has to be some sort of greedy
		// N is 10^5 for crying out loud
		
		// greedy solution?
		
		// can easily make this a square root thing if i do
		// (for k*k=N)
		// k, 2k, 3k, ... N, k-1, 2k-1, ..., ..., N-k+1
		// but is that best?
		// ...it might
		
		// but that's for N where k*k=N and k is an integer
		// ie. perfect squares
		// such that ans(N) = 2*sqrt(N)
		// what about the numbers in between?
		
		// using this code
//		for(int i = 1; i < 11; i++){
//			min = 999_999_999;
//			System.out.println(bf(new int[i], new int[i], new int[i], 0, new boolean[i]));
//			System.out.println(Arrays.toString(minArr));
//		}
		
		// brute force gives these answers
/*

2 // 1
[0]

3 // 2
[0, 1]

4
[0, 1, 2]

4 // 4
[1, 0, 3, 2]

5
[0, 2, 1, 4, 3]

5 // 6
[1, 0, 3, 2, 5, 4]

6
[0, 2, 1, 4, 3, 6, 5]

6
[1, 0, 3, 2, 5, 4, 7, 6]

6 // 9
[2, 1, 0, 5, 4, 3, 8, 7, 6]

7
[0, 3, 2, 1, 6, 5, 4, 9, 8, 7]

 */
		// which suggests that once we get to a number equal to
		// k * (k+1) for all positive k
		// (i.e. 2 = 1*2, 6=2*3, 12=3*4, etc)
		// then we are at a limit, just like at sqrt(N)
		
		// either way, time to match this strategy.
		
		int[] arr = new int[N];
		Arrays.fill(arr, -1);
		int sqN = (int)Math.sqrt(N);
		for(int n = N-1, val = N - sqN; n >= 0; n -= sqN, val -= sqN){
			val = Math.max(val, 0);
			arr[n] = val;
		}

//		System.out.println(Arrays.toString(arr));
		for(int n = N-2; n>=0; n--){
			if(arr[n] == -1){
				arr[n] = 1 + arr[n+1];
			}
		}
		
		// cool; the results EXACTLY match the brute force.
		// good luck trying to hack me.
		StringBuilder sb = new StringBuilder();
		for(int n=0;n<N;n++){
			if(n > 0) sb.append(' ');
			sb.append(arr[n]+1);
		}
		System.out.println(sb);
	}
	
	static int min = 999_999_999;
	static int[] minArr = null;
	static int[] minInc = null, minDec = null;
	static int bf(int[] arr, int[] dpInc, int[] dpDec, int i, boolean[] took){
		if(i == arr.length){
			int inc = 0, dec = 0;
			for(int n=0;n<i;n++){
				inc = Math.max(inc, dpInc[n]);
				dec = Math.max(dec , dpDec[n]);
			}
			int ret = inc + dec;
			if(ret < min){
				minArr = arr.clone();
//				minInc = dpInc.clone();
//				minDec = dpDec.clone();
				min = ret;
			}
			
			return ret;
		}
		else{
			int ret = 999_999_999;
			for(int j=0;j<arr.length;j++){
				if(!took[j]){
					took[j] = true;
					arr[i] = j;
					dpInc[i] = dpDec[i] = 1;
					for(int k = 0; k < i; k++){
						if(arr[k] < arr[i]){
							dpInc[i] = Math.max(dpInc[i], dpInc[k]+1);
						}
						if(arr[k] > arr[i]){
							dpDec[i] = Math.max(dpDec[i], dpDec[k]+1);
						}
						
					}
					ret = Math.min(ret, bf(arr, dpInc, dpDec, i+1, took));
					took[j] = false;
				}
			}
			return ret;
		}
	}
}
