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}, \ldots, a_{i_k}$ where $1\leq i_1 < i_2 < \ldots < i_k\leq n$ is called increasing if $a_{i_1} < a_{i_2} < a_{i_3} < \ldots < a_{i_k}$. If $a_{i_1} > a_{i_2} > a_{i_3} > \ldots > 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 \le n \le 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.

Difficulty: MEDIUM_HARD

Solutions:
import math
n = int(input())
width = int(math.sqrt(n))
start = n - width + 1
ans = list()
while True:
	stop = False
	for v in range(start, start + width):
		if v > 0:
			ans.append(v)
		if v < 1:
			stop = True
	start -= width
	if stop:
		break
print(*ans)


import math
n = int(input())
m = int(math.sqrt(n))
for i in range(n):
	print(max(0, n - m * (i // m + 1)) + i % m + 1, end=' ')


n = int(input())
sqr = n ** 0.5
sqr = int(sqr)
ind = []
rem = 0
while n > sqr:
	ind.extend([int(x) for x in range(n + 1 - sqr, n + 1)])
	n = n - sqr
ind.extend([int(x) for x in range(1, n + 1)])
print(*ind, sep=' ')


from math import sqrt
n = int(input())
t = int(sqrt(n))
while n > 0:
	n = n - t
	for i in range(1, t + 1):
		if n + i > 0:
			print(n + i, end=' ')


import math
n = int(input())
l = math.sqrt(n)
l = int(l)
a = []
for i in range(n):
	if n % l >= n - i:
		a.append(i + 1 - n // l * l)
	else:
		a.append(n - (i // l + 1) * l + i % l + 1)
a = map(str, a)
print(' '.join(a))


n = int(input())
a = [n - i for i in range(n)]
L = int(n ** 0.5)
a[:L] = a[L - 1::-1]
for i in range(L, n + L, L):
	a[i:i + L] = a[i + L - 1:i - 1:-1]
print(*a)


import math

def getx(n):
	return math.floor(math.sqrt(n))

def getans(n, x):
	l1 = [i for i in range(n, 0, -1)]
	l2 = []
	i = 0
	while i < n:
		l2 = l2 + sorted(l1[i:i + x])
		i += x
	return l2
n = int(input())
a = getx(n)
ans = getans(n, a)
ans1 = [str(i) for i in ans]
print(' '.join(ans1))


from math import sqrt
n = int(input())
k = int(sqrt(n))
ind = 0
curr = n
j = 0
while ind < n:
	ind += 1
	j += 1
	print(max(0, curr - k) + j, end=' ')
	if j == k:
		j = 0
		curr -= k


n = int(input())
L = int(n ** 0.5)
i = 1
k = n
a = [0] * 100005
while i <= n:
	j = min(i + L - 1, n)
	while j >= i:
		a[j] = k
		j -= 1
		k -= 1
	i += L
print(' '.join(map(str, a[1:n + 1])))


n = int(input())
import math
x = int(math.sqrt(n))
for i in range(n, 0, -x):
	for j in range(i - x + 1, i + 1):
		if j > 0:
			print(j, end=' ')


import math
a = int(input())
c = a
i = 0
ls = []
ts = []
s = math.floor(math.sqrt(a))
for j in range(a, 0, -1):
	i += 1
	ts = [j] + ts
	if not i % s:
		ls += ts
		ts = []
ls += ts
print(*ls)


import math
n = int(input())
un = int(math.sqrt(n))
ans = []
for i in range(n):
	ans.append(n - i)
b = []
for i in range(n):
	if i % un == 0:
		b.reverse()
		for j in b:
			print(j, end=' ')
		b = []
	b.append(ans[i])
b.reverse()
for i in b:
	print(i, end=' ')
print()


def inp1():
	return int(input())

def inp2():
	return list(map(int, input().split()))

def inp3():
	return map(int, input().split())
if 1:
	n = inp1()
	x = int(n ** 0.5)
	i = 0
	y = n
	ans = []
	while i < n:
		arr = []
		for j in range(x):
			if y == 0:
				break
			arr.append(y)
			y -= 1
			i += 1
			if y == 0:
				break
		arr = arr[::-1]
		for j in arr:
			ans.append(j)
	print(*ans)


import math
n = int(input())
tmp = int(math.sqrt(n))
(l, r) = (max(1, n - tmp + 1), n)
while True:
	for i in range(l, r + 1):
		print(i, end=' ')
	if l == 1:
		break
	(l, r) = (max(1, l - tmp), l - 1)


n = int(input())
import math
key = n
arr = []
for i in range(1, math.ceil(pow(n, 0.5)) + 1):
	key = key - math.floor(pow(n, 0.5))
	for j in range(1, math.floor(pow(n, 0.5)) + 1):
		if key + j > 0:
			arr.append(key + j)
for i in range(1, min(arr)):
	arr.append(i)
print(*arr)


n = int(input())
import math
d = int(math.sqrt(n))
for i in range(n // d):
	b = n - d * (i + 1) + 1
	for i in range(d):
		print(b, end=' ')
		b += 1
a = 1
for i in range(n - d * (n // d)):
	print(a, end=' ')
	a += 1


n = int(input())
s = []
val = int(pow(n, 0.5))
while n > 0:
	count = 0
	ar = []
	while n > 0 and count < val:
		count += 1
		ar.insert(0, str(n))
		n -= 1
	s.extend(ar)
print(' '.join(s))


n = int(input())
ans = []
m = int(n ** 0.5)
x = n
while x - m > 0:
	for i in range(1, m + 1):
		ans.append(x - m + i)
	x -= m
for i in range(1, x + 1):
	ans.append(i)
print(*ans)


n = int(input())
t = int(n ** 0.5)
temp = []
while n >= t:
	temp += list(range(n - t + 1, n + 1))
	n -= t
temp += list(range(1, n + 1))
print(' '.join([str(i) for i in temp]))


import math
n = int(input())
sl = int(math.sqrt(n))
meomeo = int(n / sl)
if n % sl > 0:
	meomeo += 1
result = []
for i in range(1, meomeo + 1):
	for j in range(max(1, n - i * sl + 1), n - (i - 1) * sl + 1):
		result.append(j)
for k in result:
	print(k, end=' ')
print()