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.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;
import java.util.Map.Entry;

public class Main
{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;
	private PrintWriter pw;
	private long mod = 1000000 + 3;

	private StringBuilder ans_sb;

	private void soln()
	{
		int n = nextInt();
		int sqrt = (int) Math.sqrt(n);
		int len = n / sqrt + sqrt;
		if (n % sqrt != 0) {
			len++;
		}
		int sqrt1 = sqrt + 1;
		int sqrt2 = sqrt - 1;
		while (sqrt1 <= n) {
			int len1 = n / sqrt1 + sqrt1;
			if (n % sqrt1 != 0) {
				len1++;
			}
			if (len >= len1) {
				len = len1;
				sqrt = sqrt1;
			}
			sqrt1++;
		}
		while (sqrt2 >= 1) {
			int len1 = n / sqrt2 + sqrt2;
			if (n % sqrt2 != 0) {
				len1++;
			}
			if (len >= len1) {
				len = len1;
				sqrt = sqrt2;
			}
			sqrt2--;
		}
		// debug(sqrt);
		// debug(len);
		// debug(n);
		if (sqrt * sqrt != n) {
			int n1 = n % sqrt;
			for (int i = n - n1 + 1; i <= n; i++) {
				pw.print(i + " ");
			}
			n -= n1;
		}
		// debug(n);
		// debug("yes");
		while (n != 0) {
			for (int i = n - sqrt + 1; i <= n; i++) {
				pw.print(i + " ");
			}
			n -= sqrt;
		}
		// int n = nextInt();
		// int m = nextInt();
		// int q = nextInt();
		// int pow = (int) Math.pow(2, n);
		// int[][] arr = new int[pow][105];
		// int[] arr1 = nextIntArray(n);
		// int[] a1 = new int[pow];
		// for(int i=0;i<m;i++) {
		// String s = nextLine();
		// int val = 0;
		// int pow1 = 1;
		// for(int j=n-1;j>=0;j--) {
		// if(s.charAt(j) == '1') {
		// val += pow1;
		// }
		// pow1 = pow1*2;
		// }
		// a1[val]++;
		// }
		// //debug(a1);
		// int[] vs = new int[pow];
		// for(int i=0;i<pow;i++) {
		// int j = i;
		// int kk = 0;
		// while(j != 0) {
		// int x = j%2;
		// if(x == 0)
		// vs[i] += arr1[n-kk-1];
		// j/=2;
		// kk++;
		// }
		// while(kk < n) {
		// vs[i] += arr1[n-kk-1];
		// kk++;
		// }
		// }
		// //debug(vs);
		// for(int i=0;i<pow;i++) {
		// for(int j=0;j<=i;j++) {
		// int xor = (i^j);
		// int va = vs[xor];
		// if(va <= 100) {
		// if(a1[j] != 0)
		// arr[i][va]+=a1[j];
		// if(a1[i] != 0 && i!=j)
		// arr[j][va]+=a1[i];
		// //debug(i+" "+j+" "+va);
		// }
		// }
		// }
		// //debug(arr);
		// for(int i=0;i<pow;i++) {
		// for(int j=1;j<=100;j++) {
		// arr[i][j] += arr[i][j-1];
		// }
		// }
		// while(q-- > 0) {
		// String[] s = nextLine().split(" ");
		// int k = Integer.parseInt(s[1]);
		// int val = 0;
		// int pow1 = 1;
		// for(int j=0;j<n;j++) {
		// if(s[0].charAt(j) == '1') {
		// val += pow1;
		// }
		// pow1 = pow1*2;
		// }
		// pw.println(arr[val][k]);
		// }
	}

	private String solveEqn(long a, long b)
	{
		long x = 0, y = 1, lastx = 1, lasty = 0, temp;
		while (b != 0) {
			long q = a / b;
			long r = a % b;
			a = b;
			b = r;
			temp = x;
			x = lastx - q * x;
			lastx = temp;
			temp = y;
			y = lasty - q * y;
			lasty = temp;
		}
		return lastx + " " + lasty;
	}

	private void debug(Object... o)
	{
		System.out.println(Arrays.deepToString(o));
	}

	private long pow(long a, long b, long c)
	{
		if (b == 0)
			return 1;
		long p = pow(a, b / 2, c);
		p = (p * p) % c;
		return (b % 2 == 0) ? p : (a * p) % c;
	}

	private long gcd(long n, long l)
	{
		if (l == 0)
			return n;
		return gcd(l, n % l);
	}

	public static void main(String[] args) throws Exception
	{
		new Thread(null, new Runnable()
		{
			@Override
			public void run()
			{
				new Main().solve();
			}
		}, "1", 1 << 26).start();
		// new Main().solve();
	}

	public StringBuilder solve()
	{
		InputReader(System.in);
		/*
		 * try { InputReader(new FileInputStream("C:\\Users\\hardik\\Desktop\\in.txt"));
		 * } catch(FileNotFoundException e) {}
		 */
		pw = new PrintWriter(System.out);
		// ans_sb = new StringBuilder();
		soln();

		pw.close();
		// System.out.println(ans_sb);
		return ans_sb;
	}

	public void InputReader(InputStream stream1)
	{
		stream = stream1;
	}

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

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

	private int read()
	{
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	private int nextInt()
	{
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private long nextLong()
	{
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private String nextToken()
	{
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	private String nextLine()
	{
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

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

	private long[] nextLongArray(int n)
	{
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextLong();
		}
		return arr;
	}

	private void pArray(int[] arr)
	{
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	private void pArray(long[] arr)
	{
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	private boolean isSpaceChar(int c)
	{
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	private char nextChar()
	{
		int c = read();
		while (isSpaceChar(c))
			c = read();
		char c1 = (char) c;
		while (!isSpaceChar(c))
			c = read();
		return c1;
	}

	private interface SpaceCharFilter
	{
		public boolean isSpaceChar(int ch);
	}
}