In late autumn evening n robots gathered in the cheerful company of friends. Each robot has a unique identifier — an integer from 1 to 10^9.

At some moment, robots decided to play the game "Snowball". Below there are the rules of this game. First, all robots stand in a row. Then the first robot says his identifier. After that the second robot says the identifier of the first robot and then says his own identifier. Then the third robot says the identifier of the first robot, then says the identifier of the second robot and after that says his own. This process continues from left to right until the n-th robot says his identifier.

Your task is to determine the k-th identifier to be pronounced.


-----Input-----

The first line contains two positive integers n and k (1 ≤ n ≤ 100 000, 1 ≤ k ≤ min(2·10^9, n·(n + 1) / 2).

The second line contains the sequence id_1, id_2, ..., id_{n} (1 ≤ id_{i} ≤ 10^9) — identifiers of roborts. It is guaranteed that all identifiers are different.


-----Output-----

Print the k-th pronounced identifier (assume that the numeration starts from 1).


-----Examples-----
Input
2 2
1 2

Output
1

Input
4 5
10 4 18 3

Output
4



-----Note-----

In the first sample identifiers of robots will be pronounced in the following order: 1, 1, 2. As k = 2, the answer equals to 1.

In the second test case identifiers of robots will be pronounced in the following order: 10, 10, 4, 10, 4, 18, 10, 4, 18, 3. As k = 5, the answer equals to 4.

Difficulty: EASY

Solutions:
(n, k) = map(int, input().strip().split())
ids = list(map(int, input().strip().split()))
if k == 1:
	print(ids[0])
else:
	count = 1
	for step in range(1, 100000):
		if count + step > k:
			break
		count += step
	print(ids[k - count])


(n, k) = map(int, input().split())
id = [int(i) for i in input().split()]
i = 0
s = i * (i + 1) // 2
while s <= k:
	i += 1
	s = i * (i + 1) // 2
s = (i - 1) * i // 2
k = k - s
if k == 0:
	print(id[i - 2])
else:
	print(id[k - 1])


(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
for i in range(1, len(ids) + 1):
	if i < k:
		k = k - i
	else:
		print(ids[k - 1])
		break


import math
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
p = math.ceil((-1 + (1 + 8 * k) ** 0.5) / 2)
sento = p * (p - 1) // 2 + 1
print(a[k - sento])


(n, k) = map(int, input().split())
L = list(map(int, input().split()))
i = 1
while k > 0:
	k = k - i
	i += 1
k = k + i - 1
print(L[k - 1])


import sys, math
(n, k) = list(map(int, sys.stdin.readline().split()))
lst = list(map(int, sys.stdin.readline().split()))
i = 0
tmp = 0
while tmp < k:
	i += 1
	tmp = i * (i + 1) // 2
tmp -= k
print(lst[i - 1 - tmp])


(n, k) = [int(x) for x in input().split(' ')]
ID = [int(x) for x in input().split(' ')]
k = k - 1
for i in range(0, n + 2):
	if k < i:
		break
	k -= i
print(ID[k])


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
ans = n - 1
for i in range(1, n + 1):
	if (1 + i) * i // 2 >= k:
		ans = i - 1
		break
print(arr[k - (1 + ans) * ans // 2 - 1])


(num_robots, num_identifiers) = input().split()
sequence_ids = input().split()
num_identifiers = int(num_identifiers)
for i in range(len(sequence_ids)):
	if num_identifiers - (i + 1) <= 0:
		print(sequence_ids[num_identifiers - 1])
		break
	else:
		num_identifiers -= i + 1


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
i = 1
while i < k:
	k -= i
	i += 1
print(l[k - 1])


def main():
	(n, k) = map(int, input().split())
	x = int((k * 2 - 1.5) ** 0.5 - 0.5)
	print(input().split()[k - x * (x + 1) // 2 - 1])
main()


(n, k) = map(int, input().split())
I = list(map(int, input().split()))
cnt = 1
while True:
	if k > cnt:
		k -= cnt
		cnt += 1
	else:
		print(I[k - 1])
		exit()


entrada = input().split()
robos = input().split()
n = int(entrada[0])
k = int(entrada[1])
for i in range(len(robos)):
	if k - i > 0:
		k = k - i
print(robos[k - 1])


read = lambda : list(map(int, input().split()))
(n, k) = read()
a = list(read())
s = 0
for i in range(n):
	s += i + 1
	if s >= k:
		s -= i + 1
		ind = i
		break
ans = a[k - s - 1]
print(ans)


(n, k) = map(int, input().split())
k -= 1
a = list(map(int, input().split()))
tri = [1]
for x in range(2, n + 1):
	tri.append(tri[-1] + x)
if k == 0:
	print(a[0])
else:
	lo = 0
	hi = len(tri) - 1
	while lo + 1 < hi:
		mid = (lo + hi) // 2
		if tri[mid] > k:
			hi = mid
		else:
			lo = mid
	index = k - tri[hi - 1]
	print(a[index])


entrada = list(map(int, input().split(' ')))
id = input().split(' ')
limite = entrada[1] - 1
contador = 0
while limite >= contador:
	limite -= contador
	contador += 1
print(id[limite])


(n1, k) = input().strip().split(' ')
(n1, k) = (int(n1), int(k))
l = list(map(int, input().strip().split(' ')))
n = k
m = 1
M = 10 ** 14
mid = (m + M) // 2
s = mid * (mid + 1) // 2
s1 = s + mid + 1
while not (s <= n and s1 > n):
	mid = (m + M) // 2
	s = mid * (mid + 1) // 2
	s1 = s + mid + 1
	if s < n and s1 < n:
		m = mid
	elif s > n:
		M = mid
	else:
		break
ans = mid * (mid + 1) // 2
if k > ans + 1:
	print(l[k - ans - 1])
elif k == ans:
	print(l[mid - 1])
elif k == ans + 1:
	print(l[0])


(n, k) = map(int, input().split())
ids = input().split()

def printed(robot):
	return robot * (robot + 1) // 2
start = min(1, int(((k - 1) * 2) ** 0.5))
while printed(start + 1) < k:
	start += 1
print(ids[k - printed(start) - 1])


(n, k) = map(int, input().split())
ids = input().split()
F = [0, 1]
i = 1
while F[i] < k:
	i += 1
	F.append(F[i - 1] + i)
print(ids[i - 1 - (F[i] - k)])


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
pre = 0
cur = 1
cnt = 1
while True:
	if k <= cur:
		k -= pre
		break
	else:
		cnt += 1
		pre = cur
		cur += cnt
print(a[k - 1])


a = input().split()
n = int(a[0])
k = int(a[1])
b = input().split()
soma = 0
for i in range(n + 1):
	soma += i
	if soma >= k:
		soma = i - (soma - k) - 1
		print(b[soma])
		break


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 1
while k > i:
	k -= i
	i += 1
print(a[k - 1])


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
k -= 1
for i in range(1, n + 1):
	if k - i >= 0:
		k = k - i
	else:
		break
print(a[k])


def gos(k):
	n = 1
	while n * (n + 1) // 2 < k:
		n += 1
	return n
(n, k) = [int(i) for i in input().split()]
idr = [int(i) for i in input().split()]
p = gos(k)
z = p * (p - 1) // 2
print(idr[k - z - 1])


(n, k) = map(int, input().split())
id = list(map(int, input().split(' ')))
i = 1
while k > i:
	k -= i
	i += 1
print(id[k - 1])


import sys
(n, k) = map(int, input().split())
list = list(map(int, input().split()))
sum = k
for i in range(1, sum + 1):
	if k - i > 0:
		k = k - i
	else:
		print(list[k - 1])
		sys.exit()


(n, k) = map(int, input().split())
a = [int(x) for x in input().split()]
x = 1
while k > x:
	k = k - x
	x += 1
print(a[k - 1])


entradaA = map(int, input().split())
entradaA = list(entradaA)
entradaB = map(int, input().split())
entradaB = list(entradaB)
valor = 0
for i in range(1, entradaA[0] + 1):
	valor += i
	if valor >= entradaA[1]:
		valor = i - (valor - entradaA[1])
		print(entradaB[valor - 1])
		break


import math

def get_ans():
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	cn = int(math.ceil((math.sqrt(1 + 8 * k) - 1) / 2))
	cnl = cn - 1
	cnls = cnl * (cnl + 1) // 2
	print(l[k - cnls - 1])
get_ans()


import math
(n, k) = input().split()
n = int(n)
k = int(k)
l = [0] + list(input().split())
n = math.floor((-1 + math.sqrt(1 + 8 * k)) / 2)
f = k % (n * (n + 1) // 2)
if f == 0:
	print(l[n])
else:
	print(l[f])


import math

def getX(a, b, c):
	d = b * b - 4 * a * c
	return int((-b + math.sqrt(d)) / (2 * a))

def main():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	x = getX(1, 1, -k * 2)
	last = x * (x + 1) // 2
	if last >= k:
		last -= x
	ans = k - last - 1
	print(a[ans])
main()


(n, k) = map(int, input().split())
z = list(map(int, input().split()))
c = 1
a = 0
while c <= k:
	a += 1
	c += a
print(z[k - (c - a)])


(n, m) = map(int, input().split())
k = 0
l = list(map(int, input().split()))
t = 1
while k < m:
	k = k + t
	t = t + 1
r = k - m
r = t - r - 1
print(l[r - 1])


import math
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
while i < k:
	k = k - i
	i += 1
print(a[k - 1])


[n, k] = [int(x) for x in input().split()]
id = [int(x) for x in input().split()]
m = int((2 * k) ** (1 / 2))
while m * (m + 1) < 2 * k:
	m += 1
m -= 1
print(id[int(k - m * (m + 1) / 2 - 1)])


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	(n, k) = LI()
	a = LI()
	for i in range(1, n + 1):
		if k > i:
			k -= i
		else:
			return a[k - 1]
	return -1
print(main())


(N, K) = input().split()
N = int(N)
K = int(K)
Array = list(map(int, input().split()))
i = 1
Ans = 0
while Ans + i < K:
	Ans += i
	i += 1
Ans = K - Ans
print(Array[Ans - 1])


def solve():
	mm = list(map(int, input().split()))
	n = mm[0]
	k = mm[1]
	arr = list(map(int, input().split()))
	if n == 1:
		print(arr[0])
		return
	mo = 1
	for i in range(n):
		if k == 1:
			print(arr[0])
			break
		if i == 0:
			mo = 1
		else:
			tmp = i + 1
			if mo + tmp < k:
				mo = mo + tmp
			else:
				ans = k - mo
				ans = ans - 1
				print(arr[ans])
				break
solve()


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
for i in range(n):
	if i + 1 >= k:
		print(a[k - 1])
		break
	else:
		k -= i + 1


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
for i in range(1, 100000):
	sum_of_n = i * (i + 1) // 2
	if k - sum_of_n <= i:
		if k - sum_of_n == 0:
			print(arr[i - 1])
			break
		else:
			print(arr[k - sum_of_n - 1])
			break
	else:
		continue


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
while k > 0:
	k -= i
	i += 1
	if k - i <= 0:
		break
print(a[abs(k) - 1])


(n, k) = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
k -= 1
no = int(((8 * k + 1) ** 0.5 - 1) * 0.5)
idx = k - int((no ** 2 + no) * 0.5)
print(a[idx])


import math

class codeforces:

	def holidays(self, n):
		ans = int(n / 7) * 2
		if n % 7 >= 2:
			max = ans + 2
		else:
			max = ans + n % 7
		if n % 7 > 5:
			min = ans + n % 7 - 5
		else:
			min = ans
		print(int(min), int(max))

	def robots(self, n, k, l):
		r = int((-1 + math.sqrt(1 + 8 * k)) / 2)
		temp = int(k - r * (r + 1) / 2)
		if temp == 0:
			print(l[r - 1])
		else:
			print(l[temp - 1])
s = codeforces()
d = [int(x) for x in input().split()]
n = d[0]
k = d[1]
l = [int(x) for x in input().split()]
s.robots(n, k, l)


(n, k) = map(int, input().split())
a = [int(s) for s in input().split()]
from math import sqrt
from math import ceil
p = ceil((sqrt(1 + 8 * k) - 1) / 2)
print(a[k - p * (p - 1) // 2 - 1])


(a, b) = map(int, input().split())
m = list(map(int, input().split()))
i = 1
while i < b:
	b = b - i
	i += 1
print(m[b - 1])


(n, k) = map(int, input().split())
A = list(map(int, input().split()))
cur = 1
while k > cur:
	k -= cur
	cur += 1
print(A[k - 1])


(n, k) = map(int, input().split())
i = list(map(int, input().split()))
b = []
total = 0
a = 1
while a <= n:
	total += a
	if total >= k:
		break
	a += 1
print(i[a - 1 - total % k])


(n, k) = (int(_) for _ in input().split())
a = [int(_) for _ in input().split()]
(lo, hi) = (1, n)
while lo <= hi:
	mid = lo + hi >> 1
	start = (mid - 1) * mid // 2 + 1
	end = start + mid
	if start <= k < end:
		print(a[k - start])
		break
	elif k >= end:
		lo = mid + 1
	else:
		hi = mid - 1


(a, b) = map(int, input().split())
seq = list(input().split())
i = 0
while i <= a:
	if b > i:
		b -= i
	else:
		break
	i += 1
print(seq[b - 1])


(n, k) = map(int, input().split())
n = list(map(int, input().split()))
c = 0
for i in range(0, len(n)):
	if k - i > 0:
		k = k - i
print(n[k - 1])


from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import math
import sys
(n, k) = map(int, input().split(' '))
ids = input().split(' ')
t = math.floor((-1 + math.sqrt(1 + 8 * k)) / 2)
kt = int(t * (t + 1) / 2)
sys.stderr.write('{} {}'.format(kt, k - kt))
if k == kt:
	print(ids[t - 1])
else:
	print(ids[k - kt - 1])


linha1 = input().split()
n = int(linha1[0])
k = int(linha1[1])
ids = input().split()
result = []
cont = 0
for i in range(1, n + 1):
	cont += i
	if cont >= k:
		cont -= i
		print(ids[k - cont - 1])
		break


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
i = 1
t = 0
s = 0
while k > i:
	k = k - i
	i = i + 1
print(l[k - 1])


import math
(n, k) = [int(x) for x in input().split()]
ID = [int(x) for x in input().split()]
m = math.floor(((1 + 8 * (k - 1)) ** 0.5 - 1) / 2)
print(ID[k - 1 - m * (m + 1) // 2])


import math
(n, k) = map(int, input().split())
l = list(map(int, input().split()))
a = math.floor((-1 + math.sqrt(1 + 8 * k)) / 2)
t = a * (a + 1) // 2
if k == t:
	print(l[a - 1])
else:
	k -= t
	print(l[k - 1])


def main():
	(nrobots, pos) = [int(c) for c in input().split()]
	robots = list([int(c) for c in input().split()])
	i = 1
	inf = 0
	pos -= 1
	while i <= nrobots:
		cur = i * (i + 1) // 2 - 1
		if cur > pos:
			break
		elif cur == pos:
			print(robots[i - 1])
			return
		else:
			inf = cur
		i += 1
	ans = robots[pos - inf - 1]
	print(ans)
main()


(n, k) = map(int, input().split(' '))
arr = [*map(int, input().split(' '))]
for i in range(1, n + 1):
	if k <= i:
		print(arr[k - 1])
		break
	else:
		k = k - i


(n, k) = input().split(' ')
n = int(n)
k = int(k)
a = [int(i) for i in input().split()]
i = n
m = int(n * (n + 1) / 2)
while k <= m:
	i -= 1
	m = int(i * (i + 1) / 2)
print(a[k - m - 1])


(n, k) = map(int, input().split())
help = k
data = list(map(int, input().split()))
count = 1
s = 0
while s < k:
	s += count
	count += 1
k -= s - count + 1
print(data[k - 1])


import math
(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
numb = math.floor((-1 + math.sqrt(1 + 8 * k)) / 2)
ans = k - numb * (numb + 1) // 2
if ans == 0:
	ans = numb
print(ids[ans - 1])


(n, k) = map(int, input().split(' '))
ids = input().split(' ')
t = int((k * 2) ** 0.5)
while t * (t + 1) // 2 < k:
	t += 1
print(ids[k - (t - 1) * t // 2 - 1])


(n, k) = str(input()).split()
(n, k) = (int(n), int(k))
line = str(input()).split()
line = [int(it) for it in line]
s = 0
while k > s:
	k -= s
	s += 1
print(line[k - 1])


def main():
	(n, k) = (int(x) for x in input().split())
	L = [int(x) for x in input().split()]
	result = solver(n, k, L)
	print(result)

def solver(n, k, L):
	i = quadraticEqPlus(1, 1, -2 * k)
	inti = int(i)
	lastRound = inti * (inti + 1) // 2
	if k - lastRound == 0:
		return L[inti - 1]
	else:
		return L[k - lastRound - 1]

def quadraticEqPlus(a, b, c):
	return (-b + (b ** 2 - 4 * a * c) ** 0.5) / (2 * a)
main()


def robot(n, k, id):
	current = 0
	robot_no = 1
	while current < k:
		current += robot_no
		robot_no += 1
	robot_no -= 1
	current -= robot_no
	diff = k - current
	return id[diff - 1]
(n, k) = list(map(int, input().split()))
id = list(map(int, input().split()))
print(robot(n, k, id))


(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
cnt = 1
while k > cnt:
	k -= cnt
	cnt += 1
print(ids[k - 1])


(n, k) = [int(i) for i in input().split()]
ids = [int(i) for i in input().split()]
num = 0
for i in range(1, k + 1):
	if i * (i + 1) / 2 >= k:
		num = i - (i * (i + 1) // 2 - k) - 1
		break
print(ids[num])


(n, k) = list(map(int, input().split()))
xs = list(map(int, input().split()))
i = 0
while k > 0:
	i += 1
	h = k
	k -= i
print(xs[h - 1])


(n, k) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
num = 1
sum = 0
while sum < k:
	sum += num
	num += 1
sum = sum - num
sum = k - sum
print(a[sum - 2])


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

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

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ''.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber
(n, k) = mi()
ids = li()
n = int(math.sqrt(2 * k + 0.25) - 0.5)
if k == 1:
	print(ids[0])
elif abs(math.sqrt(2 * k + 0.25) - 0.5 - n) < 10 ** (-6):
	print(ids[:n][-1])
else:
	print(ids[k - 1 - n * (n + 1) // 2])


a = input().split()
b = input().split()
a1 = int(a[0])
a2 = int(a[1])
temp = 0
i = 0
while i < a2 + 1:
	if i * (i + 1) / 2 >= a2:
		temp = i - 1
		break
	i += 1
i = a2 - temp * (temp + 1) / 2
i = int(i)
if a1 == 1:
	print(b[0])
else:
	print(b[i - 1])


inputs = input().split()
n = int(inputs[0])
k = int(inputs[1])
ids = input().split()
if k == 0:
	print(0)
else:
	t = 1
	while True:
		if k <= t:
			break
		k -= t
		t += 1
	print(ids[k - 1])


(n, k) = map(int, input().split())
m = list(map(int, input().split()))
a = round((2 * k) ** (1 / 2))
a = a - 1
a = a * (a + 1) // 2
print(m[k - a - 1])


import math
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
d = math.sqrt(1 + 8 * k)
x = int((-1 + d) * 0.5)
sum_blocks = (1 + x) * x // 2
if sum_blocks == k:
	print(a[x - 1])
else:
	y = abs(sum_blocks - k)
	print(a[y - 1])


(_, k) = map(int, input().split())
robots = input().split()
i = 1
while k > i:
	k -= i
	i += 1
print(robots[k - 1])


import itertools as it
import functools
import operator
import collections
import math
import sys

def solve(n, k, xs):
	ii = next((i for i in range(1, n + 1) if 2 * k <= (i + 1) * (i + 2)))
	p = k - ii * (ii + 1) // 2
	if p == 0:
		return xs[ii - 1]
	return xs[p - 1]

def pp(*args, **kwargs):
	return print(*args, file=sys.stderr, **kwargs)

def main():
	(n, k) = map(int, input().strip().split())
	xs = [int(i) for i in input().strip().split()]
	assert len(xs) == n
	result = solve(n, k, xs)
	print(result)
main()


nk = input().split()
n = int(nk[0])
k = int(nk[1])
seq = input().split()
for i in range(0, n):
	seq[i] = int(seq[i])
sum_n = 0
for i in range(1, n + 1):
	sum_n = sum_n + i
	if sum_n > k:
		sum_b = sum_n - i
		k = seq[k - sum_b - 1]
		break
	if sum_n == k:
		k = seq[i - 1]
		break
print(k)


def inp():
	return map(int, input().split())

def arr_inp():
	return [int(x) for x in input().split()]
(n, k) = inp()
(id, ans, tem) = (arr_inp(), 1, 0)
for i in range(2, k + 1):
	if ans >= k:
		break
	tem = ans
	ans += i
print(id[k - tem - 1])


(x, y) = map(int, input().split())
ide = list(map(int, input().split()))
cnt = 0
for i in range(1, x + 1):
	cnt += i
	if cnt >= y:
		ans = ide[y - (cnt - i) - 1]
		print(ans)
		break


(n, k) = map(int, input().split())
L = list(map(int, input().split()))
s = 0
for i in range(1, n + 1):
	s += i
	if s >= k:
		print(L[k - (s - i) - 1])
		break


(n, k) = map(int, input().strip().split())
num = list(map(int, input().strip().split()))
for i in range(1, n + 1):
	if k <= i:
		print(num[k - 1])
		break
	k -= i


entrada1 = list(map(int, input().split()))
entrada2 = list(map(int, input().split()))
sum = 0
for i in range(1, entrada1[0] + 1):
	sum = sum + i
	if sum >= entrada1[1]:
		sum = i - (sum - entrada1[1])
		print(entrada2[sum - 1])
		break


from math import sqrt

def segment(k):
	return int(-1 / 2 + sqrt(1 / 4 + 2 * k))
(n, k) = map(int, input().split())
identity = list(map(int, input().split()))
a = segment(k)
diff = k - a * (a + 1) // 2
slicedList = [identity[:a][-1]] + identity[:a]
print(slicedList[diff])


from math import *
(n, k) = map(int, input().split())
a = list(map(int, input().split()))
m = floor(((1 + 8 * k) ** 0.5 - 1) / 2)
d = k - m * (m + 1) // 2
print(a[d - 1] if d else a[m - 1])


(n, k) = map(int, input().split())
m = input().split()
a = int((-1 + (8 * k + 1) ** 0.5) / 2)
b = k - int(a * (a + 1) / 2)
print(m[(b or a) - 1])


I = lambda : list(map(int, input().split()))
(n, k) = I()
i = 0
while i < k:
	k -= i
	i += 1
print(I()[k - 1])


(a, b) = map(int, input().split())
s = 0
i = 1
while s + i < b:
	s += i
	i += 1
print(int(input().split()[b - s - 1]))


(r, n) = map(int, input().split())
l = list(map(int, input().split()))
a = 0
for i in range(1, n + 1):
	if a + i < n:
		a += i
	else:
		p = n - a
		break
print(l[p - 1])


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
i = 1
while True:
	if k - i <= 0:
		break
	k -= i
	i += 1
print(l[k - 1])


I = lambda : list(map(int, input().split()))
(n, k) = I()
a = I()
k0 = int((k * 2) ** 0.5)
st = k0
k -= k0 * (k0 - 1) // 2
while k > st:
	k -= st
	st += 1
print(a[k - 1])


s = input().split()
(n, k) = (int(s[0]), int(s[1]))
id = list(map(lambda x: int(x), input().split()))
c = 1
d = 1
while c + d <= k:
	c += d
	d += 1
print(id[k - c])


(a, b) = map(int, input().split(' '))
c = input().split(' ')
b = b - 1
for i in range(0, a + 2):
	if b < i:
		break
	b -= i
print(c[b])


import sys
input = sys.stdin.readline

def main():
	(n, k) = map(int, input().split())
	id = list(map(int, input().split()))
	m = 0
	while m * (m + 1) < 2 * k:
		m += 1
	m -= 1
	k -= m * (m + 1) // 2
	print(id[k - 1])
main()


(n, k) = [int(s) for s in input().split()]
ids = [int(s) for s in input().split()]
(sum, sums) = (0, [])
for i in range(1, k + 1):
	sum += i
	sums.append(sum)
	if sum > k:
		break
for (i, sum) in enumerate(sums):
	if sum >= k:
		break
round = i + 1
if round == 1:
	id = 0
else:
	prev_sum = sums[i - 1]
	id = k - prev_sum - 1
print(ids[id])


(n, k) = map(int, input().split())
x = list(map(int, input().split()))
a = n * [0]
ans = 0
for i in range(1, n + 1):
	ans += i
	a[i - 1] = ans
	if ans >= k:
		print(x[k - a[i - 2] - 1])
		break


(n, k) = [int(x) for x in input().split()]
s = [int(x) for x in input().split()]
i = 0
while (i + 1) * (i + 2) // 2 < k:
	i += 1
k -= (i + 1) * i // 2
print(s[k - 1])


string = input()
numbers = string.split()
(a, b) = (int(numbers[0]), int(numbers[1]))
string = input()
numbers = list(map(int, string.split()))
x = 0
while True:
	x += 1
	y = x * (x + 1) // 2
	if y >= b:
		break
x -= 1
y = x * (x + 1) // 2
z = 0
while y < b:
	y += 1
	z += 1
print(numbers[z - 1])


from bisect import bisect_left
(n, k) = list(map(int, input().split()))
ids = list(map(int, input().split()))
a = [x * (x + 1) // 2 for x in range(n + 1)]
y = bisect_left(a, k)
print(ids[k - a[y - 1] - 1])


import math
(n, k) = map(int, input().split())
l_i = list(map(int, input().split()))
x = int((-1 + math.sqrt(1 + 4 * 2 * k)) // 2)
if (x ** 2 + x) // 2 == k:
	print(l_i[x - 1])
else:
	print(l_i[k - (x ** 2 + x) // 2 - 1])


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
temp = 1
while temp < k:
	k -= temp
	temp += 1
print(l[k - 1])


(n, k) = map(int, input().split())
idt = list(map(int, input().split()))
(t, count) = (0, 0)
for i in range(1, n + 1):
	count += i
	t = i
	if count >= k:
		break
ans = t - (count - k)
print(idt[ans - 1])


import math
from collections import defaultdict
ml = lambda : map(int, input().split())
ll = lambda : list(map(int, input().split()))
ii = lambda : int(input())
ip = lambda : input()
(a, k) = ml()
v = ll()
i = 1
while i < k:
	k -= i
	i += 1
print(v[k - 1])


import sys, math
(n, k) = map(int, sys.stdin.readline().split())
ids = list(map(int, sys.stdin.readline().split()))
i = int(math.sqrt(8 * k + 1) - 1) // 2
si = i * (i + 1) // 2
if k > si:
	res = k - si
else:
	res = k + i - si
print(ids[res - 1])


from math import ceil
(n, k) = map(int, input().split())
id = list(map(int, input().split()))
x = ceil(((1 + 8 * k) ** 0.5 - 1) / 2)
sus = x * (x - 1) // 2
print(id[k - sus - 1])


def main():
	(n, k) = map(int, input().split())
	id = list(map(int, input().split()))
	n = 1
	sum = 0
	while sum < k:
		sum = n * (n + 1) / 2
		n += 1
	z = n - 2
	sum2 = z * (z + 1) / 2
	ind = int(k - sum2)
	ans = id[ind - 1]
	print(ans)
main()


(n, k) = map(int, input().split())
siquence = input().split()
counter = 1
buf = 0
while buf < k:
	buf += counter
	counter += 1
buf -= counter - 1
i = k - buf - 1
print(siquence[i])


(n, k) = map(int, input().split())
(c, id) = (1, list(map(int, input().split())))
while k > c:
	(k, c) = (k - c, c + 1)
print(id[k - 1])


def I():
	return list(map(int, input().split()))
(n, k) = I()
i = 0
while i < k:
	k -= i
	i += 1
print(I()[k - 1])


import math
(b, a) = [int(i) for i in input().split()]
s = [int(i) for i in input().split()]
t = math.floor(math.sqrt(a * 2))
if a < t * (t + 1) // 2:
	t -= 1
if a == t * (t + 1) // 2:
	print(s[t - 1])
else:
	print(s[a - t * (t + 1) // 2 - 1])


(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
p = round(((8 * k + 1) ** 0.5 - 1) / 2)
if p * (p + 1) // 2 == k:
	p -= 1
else:
	p = int(((8 * k + 1) ** 0.5 - 1) / 2)
i = k - p * (p + 1) // 2
print(ids[i - 1])


import sys

def binary_search(left, right, count):
	while right - left > 1:
		middle = (left + right) // 2
		if middle * (middle + 1) // 2 < count:
			left = middle
		else:
			right = middle
	if right * (right + 1) // 2 < count:
		return right
	else:
		return left
(n, k) = [int(i) for i in sys.stdin.readline().strip().split()]
id = [int(i) for i in sys.stdin.readline().strip().split()]
pos = binary_search(0, n, k)
kth = k - pos * (pos + 1) // 2 - 1
print(id[kth])


(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
q = 1
while k > q:
	k -= q
	q += 1
print(ids[k - 1])


from sys import stdin

def main():
	(n, k) = tuple([int(i) for i in stdin.readline().split()])
	identifier = stdin.readline().split()
	for i in range(1, n + 1):
		if k - i <= 0:
			print(identifier[k - 1])
			break
		k -= i
main()


import sys
(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
cnt = 1
while k > cnt:
	k -= cnt
	cnt += 1
print(arr[k - 1])


(many, which) = map(int, input().split(' '))
numbers = input().split(' ')
sam = 0
for i in range(1, many + 1):
	sam += i
	if sam >= which:
		print(numbers[which - (sam - i) - 1])
		break


[n, k] = list(map(int, input().split()))
id = list(map(int, input().split()))
p = 0
for a in range(0, n + 1):
	x = int((a + 1) * (a + 2) / 2)
	if x >= k:
		p = a
		break
k -= int(p * (p + 1) / 2)
print(id[k - 1])


(n, k) = map(int, input().split())
nums = list(map(int, input().split()))
now = 0
i = 0
while 1 == 1:
	i += 1
	now += i
	if now >= k:
		now -= i
		k -= now
		break
print(nums[k - 1])


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(l, r) = (1, n)
while l <= r:
	m = (l + r) // 2
	id1 = m * (m - 1) // 2
	id2 = m * (m + 1) // 2
	if k <= id1:
		r = m - 1
	elif k > id2:
		l = m + 1
	else:
		print(a[k - m * (m - 1) // 2 - 1])
		break


(n, k) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
if k == 1:
	print(a[0])
elif k == 2:
	print(a[0])
elif k == 3:
	print(a[1])
else:
	n = 0
	while (n + 1) * (n + 2) // 2 < k:
		n += 1
	triangle = (n + 1) * (n + 2) // 2
	pos = n
	while triangle > k:
		pos -= 1
		triangle -= 1
	print(a[pos])


import math
s = input()
n = int(s.split()[0])
k = int(s.split()[1])
s = input()
arr = s.split()
for i in range(0, n):
	arr[i] = int(arr[i])
q = math.ceil((8 * k + 1) ** 0.5) // 2
print(arr[k - 1 - q * (q - 1) // 2])


(n, m) = map(int, input().split())
c = list(map(int, input().split()))
i = 1
while (m - 1) // i > 0:
	m -= i
	i += 1
print(c[(m - 1) % i])


import sys
from collections import Counter
input = lambda : sys.stdin.readline()
int_arr = lambda : list(map(int, input().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().split())
get_int = lambda : map(int, input().split())
get_flo = lambda : map(float, input().split())
mod = 1000000007

def solve(n, k, arr):
	i = 0
	while i < k:
		k -= i
		i += 1
	print(arr[k - 1])
(n, k) = get_int()
arr = int_arr()
solve(n, k, arr)


def main():
	(n, k) = map(int, input().split())
	ids = list(map(int, input().split()))
	res = 0
	for i in range(1, n + 1):
		ik = i * (i + 1) // 2
		if ik >= k:
			res = i - (ik - k)
			res = ids[res - 1]
			break
	print(res)
main()


(k, n) = map(int, input().split())
l = list(map(int, input().split()))

def findNumber(n):
	n -= 1
	i = 1
	while n >= 0:
		n -= i
		i += 1
	return n + i
p = findNumber(n) - 1
print(l[p])


from sys import *
from itertools import *
input = lambda : stdin.readline()
int_arr = lambda : list(map(int, stdin.readline().strip().split()))
str_arr = lambda : list(map(str, stdin.readline().split()))
get_str = lambda : map(str, stdin.readline().strip().split())
get_int = lambda : map(int, stdin.readline().strip().split())
get_float = lambda : map(float, stdin.readline().strip().split())
mod = 1000000007
setrecursionlimit(1000)
(n, k) = get_int()
arr = int_arr()
lst = [0] * n
dic = {}
for i in range(1, n + 1):
	lst[i - 1] = i
lst = list(accumulate(lst))
for i in range(n):
	dic[lst[i]] = i
for i in range(n):
	if lst[i] == k:
		print(arr[dic[lst[i]]])
		break
	if lst[i] > k:
		val = k - lst[i - 1]
		print(arr[val - 1])
		break


def main():
	(n, k) = [int(x) for x in input().split()]
	li = list(map(int, input().split()))
	sn = [0] * n
	sn[0] = 1
	for i in range(1, len(sn)):
		sn[i] = sn[i - 1] + (i + 1)
	for i in range(len(sn)):
		if sn[i] > k:
			print(li[k - sn[i - 1] - 1])
			break
		elif sn[i] == k:
			print(li[i])
			break
main()


import math
(n, k) = map(int, input().split())
lst = list(map(int, input().split()))
l = 1
r = min(2 * 10 ** 9 + 1, n * (n + 1) / 2)
while r > l:
	m = math.floor((l + r) / 2)
	if (m + 1) / 2 * m < k:
		l = m + 1
	else:
		r = m
print(lst[k - int(l * (l - 1) / 2) - 1])


(n, k) = map(int, input().split())
lis = list(map(int, input().split()))
c = ans = 1
dif = 2
while ans <= k:
	if ans == k:
		print(lis[dif - 2])
		exit()
	elif ans > k:
		ans -= dif
		ans += 1
		print(lis[k - ans - 1], dif)
		exit()
	ans += dif
	dif += 1
ans -= dif
ans += 1
print(lis[k - ans - 1])


from math import sqrt, fabs
(n, k) = map(int, input().split())
ids = input().split()
k_original = k
while True:
	m = (sqrt(1 + 8 * k) - 1) / 2
	if fabs(m - int(m)) < 1e-05:
		break
	k -= 1
dif = k_original - k
if dif == 0:
	dif = int(m)
print(ids[dif - 1])


(n, k) = map(int, input().split())
robots = list(map(int, input().split()))
count = 0
for i in range(1, n + 1):
	count += i
	if count < k:
		continue
	else:
		count -= i
		print(robots[k - count - 1])
		break


try:
	while True:
		(n, k) = list(map(int, input().split()))
		a = list(map(int, input().split()))
		for i in range(1, n + 1):
			if k <= i:
				print(a[k - 1])
				break
			k -= i
except EOFError:
	pass


def p1():
	n = int(input())
	for i in range(0, n, 1234567):
		for j in range(0, n - i, 123456):
			if (n - i - j) % 1234 == 0:
				return 'YES'
	return 'NO'

def p2():
	(n, m) = [int(i) for i in input().split()]
	l = [int(i) for i in input().split()]
	for i in range(n):
		if m - i - 1 <= 0:
			return l[m - 1]
		m = m - i - 1

def p3():
	n = int(input())
	b = n // 7 * 2 + min(2, n % 7)
	a = n // 7 * 2
	if n == n // 7 * 7 + 6:
		a = a + 1
	print(a, b)
print(p2())


(n, k) = map(int, input().split())
w = dict(zip(range(n), map(int, input().split())))
for i in range(n):
	if k > i:
		k -= i
	else:
		break
print(w[k - 1])


from sys import stdin, stdout
(n, k) = map(int, stdin.readline().split())
number = [0]
for i in range(n):
	number.append(number[-1] + i + 1)
	if number[-1] >= k:
		ind = i
		cnt = number[-2]
		break
values = list(map(int, stdin.readline().split()))
for i in range(ind + 1):
	if cnt + i + 1 == k:
		stdout.write(str(values[i]))
		break


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
b = list()
c = 1
d = w = 0
for i in range(100000):
	b.append(c)
	if c == k:
		w = i
		break
	elif c > k:
		w = i - 1
		break
	d += 1
	c += d
print(a[k - b[w]])


import math
(n, k) = map(int, input().split())
A = list(map(int, input().split()))
x = int((-1 + math.sqrt(1 + 8 * k)) / 2)
if k == (1 + x) * x // 2:
	print(A[x - 1])
else:
	print(A[k - (1 + x) * x // 2 - 1])


aa = input()
a = [int(n) for n in aa.split()]
n = a[0]
m = a[1]
aa = input()
a = [int(i) for i in aa.split()]
j = 1
while m > j:
	m -= j
	j += 1
print(a[m - 1])


(n, k) = map(int, input().split(' '))
m = list(map(int, input().split(' ')))
for i in range(1, n + 1):
	if (1 + i) * i // 2 >= k:
		print(m[k - i * (i - 1) // 2 - 1])
		break


(n, k) = map(int, input().split(' '))
id = input().split(' ')
s = 0
for i in range(1, 999999999):
	t = s + i
	if s < k <= t:
		k -= s
		print(id[k - 1])
		break
	s = t


(n, m) = map(int, input().split())
a = [int(x) for x in input().split()]
sumx = 0
for i in range(n):
	sumx += i + 1
	if sumx >= m:
		print(a[m - (sumx - i - 1) - 1])
		break


nk = input().split()
id = input().split()
n = int(nk[0])
k = int(nk[1])
for i in range(n):
	if i >= k:
		break
	k -= i
print(id[k - 1])


cnt = lambda s, x: s.count(x)
ii = lambda : int(input())
si = lambda : input()
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
dgl = lambda : list(map(int, input()))
(n, k) = f()
l = il()
i = 1
while i * (i + 1) // 2 < k:
	i += 1
dif = k - (i - 1) * i // 2
print(l[dif - 1])


(a, b) = map(int, input().split())
l = list(map(int, input().split()))
count = int(b)
for i in range(1, len(l) + 1):
	if count > i:
		count -= i
	else:
		print(l[count - 1])
		break


(N, K) = map(int, input().split())
Identifiers = list(map(int, input().split()))
(Number, Adder) = (0, 1)
while Number < K:
	(Number, Adder) = (Number + Adder, Adder + 1)
print(Identifiers[Adder - 2 - (Number - K)])


(n, k) = map(int, input().split(' '))
ids = list(map(int, input().split(' ')))
cur = 1
while k > cur:
	k -= cur
	cur += 1
print(ids[k - 1])


(a, k) = map(int, input().split())
ids = list(map(int, input().split()))
for e in range(1, a + 1):
	if k - e > 0:
		k = k - e
	else:
		val = ids[k - 1]
		print(val)
		break


from __future__ import print_function

def get_recited_index(n, k):
	i = 0
	while i * (i + 1) / 2 <= k:
		i += 1
	required = i - 1
	return (int(k - required * (required + 1) / 2), required)
a = [int(x) for x in input().split()]
n = a[0]
k = a[1]
l = input().split()
(index, req) = get_recited_index(n, k)
if index == 0:
	print(l[req - 1])
else:
	print(l[index - 1])


def funcao(lista, k):
	soma = 0
	for i in range(1, len(lista) + 1):
		soma += i
		if soma >= k:
			return lista[i - (soma - k) - 1]
k = int(input().split()[1])
lista = input().split()
print(funcao(lista, k))


(k, p) = map(int, input().split())
h = list(map(int, input().split()))
x = 1
while p > x:
	p = p - x
	x = x + 1
print(h[p - 1])


(n, k) = map(int, input().split())
ids = input().split()
x = 1
while k > x:
	k -= x
	x += 1
print(ids[k - 1])


import math
(n, k) = map(int, input().split())
id = list(map(int, input().split()))
i = (-1 + math.sqrt(8 * k + 1)) / 2
if int(i) == i:
	i = int(i)
	print(id[i - 1])
else:
	i = int(i)
	s = i * (i + 1) // 2
	print(id[k - s - 1])


(n, k) = map(int, input().split())
ID = input().split()
t = 1
while k > t:
	k -= t
	t += 1
print(ID[k - 1])


(n, k) = map(int, input().split())
ids = [int(x) for x in input().split()]
r = int((1 + (8 * k - 7) ** 0.5) / 2)
i = k - r * (r - 1) // 2 - 1
print(ids[i])


(n, k) = map(int, input().split())
ids = input().split()
sum_to = int((-1 + (1 + 8 * k) ** 0.5) / 2)
offset = k - sum_to * (sum_to + 1) // 2
print(ids[(offset if offset != 0 else sum_to) - 1])


import math
n = input().split()
k = int(n[1])
n = int(n[0])
id = input().split()
a = (k * 2) ** 0.5
a = math.ceil(a) - 2
if (a + 1) * a / 2 < k and (a + 2) * (a + 1) / 2 >= k:
	a = a
elif (a + 2) * (a + 1) / 2 < k and (a + 2) * (a + 3) / 2 >= k:
	a = a + 1
elif (a + 2) * (a + 3) / 2 < k and (a + 4) * (a + 3) / 2 >= k:
	a = a + 2
answ = int(k - (a + 1) * a / 2 - 1)
print(id[answ])


(n, k) = map(int, input().strip().split())
arr = list(map(int, input().strip().split()))
c = 1
x = 1
while True:
	if c + x > k:
		print(arr[k - c])
		break
	c += x
	x += 1


import math
(n, k) = map(int, input().split())
l = list(map(int, input().split()))
x = math.sqrt(1 / 4 + k * 2) - 0.5
x = math.ceil(x)
k -= int(x * (x - 1) / 2)
print(l[k - 1])


(l, k) = map(int, input().split())
x = list(map(int, input().split()))
count = 0
k -= 1
while k != 0:
	if k >= count:
		k -= count
	else:
		break
	count += 1
print(x[k])


(n, k) = map(int, input().split())
l = [int(num) for num in input().split()]
for i in range(1, n + 1):
	if k - i > 0:
		k = k - i
	else:
		print(l[k - 1])
		break


(n, k) = list(map(int, input().split()))
t = list(map(int, input().split()))
for i in range(1, 100000000):
	a = i * (i + 1) // 2
	if i < k:
		k -= i
	elif i == k:
		print(t[i - 1])
		break
	else:
		print(t[k - 1])
		break


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
rez = [a[0]]
v = 1
for i in range(1, n + 2):
	if v >= k:
		print(rez[k - 1])
		break
	k -= v
	rez.append(a[i])
	v += 1


list1 = list(map(int, input().split()))
n = list1[0]
k = list1[1]
robotsSequence = list(map(int, input().split()))

def my_function(n, k, robotsSequence):
	for i in range(1, n + 1, 1):
		length = i * (i + 1) / 2
		if length >= k:
			retreat = length - k
			index = n - 1 - (n - i) - retreat
			return robotsSequence[int(index)]
print(my_function(n, k, robotsSequence))


(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
summa = 0
for i in range(n + 1):
	summa += i
	last = i
	if summa >= k:
		break
print(ids[k - summa + last - 1])


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
num = 1
while k > num:
	k -= num
	num += 1
print(a[k - 1])


(n, k) = map(int, input().split())
(IDs, i) = (list(map(int, input().split())), 0)
while (i + 1) * (i + 2) // 2 < k:
	i += 1
print(IDs[k - i * (i + 1) // 2 - 1])


(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
row = 1
while k - row > 0:
	k -= row
	row += 1
print(ids[k - 1])


from collections import deque as de
import math
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb
from fractions import Fraction as fr

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def ceildiv(x, y):
	return (x + y - 1) // y

def di():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))
(n, k) = di()
dic = {}
for (i, v) in enumerate(input().split()):
	dic[i + 1] = int(v)
if k == 1 or k == 2:
	print(dic[1])
else:
	for i in range(1, 1000000):
		s = i * (i + 1) // 2
		if s >= k:
			break
	if s == k:
		print(dic[i])
	else:
		diff = s - k
		print(dic[i - diff])


nums = input().split()
n = int(nums[0])
k = int(nums[1])
robots = input().split()
count = 0
for i in range(1, n + 1):
	count += i
	if count >= k:
		count -= i
		print(robots[k - count - 1])
		break


import math
(n, k) = map(int, input().split())
sequence = list(map(int, input().split()))
upperbound = math.ceil((-1 + (1 + 8 * k) ** 0.5) / 2)
lowerbound = upperbound - 1
index = int(k - lowerbound * (lowerbound + 1) / 2)
print(sequence[index - 1])


(n, k) = map(int, input().split())
robot = input().split()
j = 0
for i in range(1, n + 1):
	j += i
	if j >= k:
		break
if j == k:
	print(robot[i - 1])
else:
	j = j - i
	print(robot[k - j - 1])


def solve(n, k):
	tmp = 0
	i = 0
	while tmp < k:
		i += 1
		tmp += i
	tmp -= i
	return k - tmp - 1
data = input().split()
data2 = input().split()
ind = solve(int(data[0]), int(data[1]))
print(data2[ind])


(n, k) = [int(x) for x in input().split()]
ids = [int(n) for n in input().split()]

def calcIndex():
	sum = 0
	for i in range(1, n + 1):
		if sum + i < k:
			sum = sum + i
		else:
			return k - sum
	return k - sum
ind = calcIndex()
print(ids[ind - 1])


(n, k) = input().split()
(n, k) = (int(n), int(k))
l = input().split()
p = int(((8 * k + 1) ** 0.5 - 1) / 2)
r = k - int(p * (p + 1) / 2) - 1
if r == -1:
	print(l[p - 1])
else:
	print(l[r])


(n, k) = map(int, input().split())
a = input().split()
t = 1
while k - t > 0:
	k -= t
	t += 1
print(a[k - 1])


inp = input().split()
(n, k) = (int(inp[0]), int(inp[1]))
a = input().split()
i = 1
while k - i > 0:
	k -= i
	i += 1
print(a[k - 1])


(n, k) = map(int, input().split())
d = list(map(int, input().split()))
sum = 0
r = 0
for i in range(1, n + 1):
	sum += i
	if sum >= k:
		print(d[k - sum + i - 1])
		break


m = 8
(n, k) = list(map(int, input().split()))
ids = list(map(int, input().split()))
x = 0
i = 1
while x + i < k:
	x += i
	i += 1
res = k - x
print(ids[res - 1])


from math import sqrt
(n, k) = map(int, input().split())
xs = [int(x) for x in input().split()]
k -= 1

def m(k):
	return int((1 + sqrt(1 + 8 * k)) / 2)

def b(k):
	c = m(k)
	return c * (c - 1) // 2
sol = xs[k - b(k)]
print(sol)


def solution(robots, k):
	count = 0
	for i in range(len(robots)):
		count += i + 1
		if count >= k:
			break
	robots = robots[:i + 1]
	return robots[k - count - 1]
(n, k) = list(map(int, input().split()))
robots = list(map(int, input().split()))
print(solution(robots, k))


(n, k) = map(int, input().split())
arr = list(map(int, input().split()))
pos = 1
while k > pos:
	k -= pos
	pos += 1
print(arr[k - 1])


def robot_number(n, k, lst):
	counter = 0
	i = 1
	while True:
		if counter + i < k:
			counter += i
			i += 1
			continue
		else:
			return lst[k - counter - 1]
(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
print(robot_number(n, k, ids))


(n, k) = map(int, input().split())
a = [int(i) for i in input().split()]
import math
h = round(math.sqrt(k * 2))
for i in range(h, -1, -1):
	if k > round(i * (i + 1) / 2):
		break
	else:
		h -= 1
k = k - round(h * (h + 1) / 2)
if k == 0:
	print(a[len(a) - 1])
else:
	print(a[k - 1])


nk = input().split()
(n, k) = (int(nk[0]), int(nk[1]))
arr = list(map(int, input().split()))
i = 1
while i < k:
	k -= i
	i += 1
print(arr[k - 1])


m = input().split()
n = int(m[0])
k = int(m[1])
ids = input().split()
for i in range(n):
	lbound = int(i * (i + 1) / 2) + 1
	ubound = int(lbound + i)
	if k <= ubound and k >= lbound:
		inner_index = k - lbound
		print(ids[inner_index])


import math
(n, k) = [int(x) for x in input().split()]
R = [int(x) for x in input().split()]
c = int(math.floor((-1 + math.sqrt(1 + 8 * k)) / 2))
closest = int(c * (c + 1) / 2)
if k - closest == 0:
	print(R[c - 1])
else:
	print(R[k - 1 - closest])


(n, k) = map(int, input().split())
val = list(map(int, input().split()))
i = 1
while k > i:
	k -= i
	i += 1
print(val[k - 1])


from sys import stdin, stdout

def robots(n, k, ids):
	for i in range(n):
		if k < i + 1:
			return ids[k]
		k = k - (i + 1)
(n, k) = stdin.readline().split(' ')
(n, k) = (int(n), int(k.replace('\n', '')))
id = stdin.readline().split(' ')
id[-1] = id[-1].replace('\n', '')
stdout.write(str(robots(n, k - 1, id)) + '\n')


import sys
import math
import itertools as it
import operator as op
import fractions as fr
(n, k) = map(int, sys.stdin.readline().split())
ids = list(map(int, sys.stdin.readline().split()))
p = 1
while k >= p + 1:
	k -= p
	p += 1
print(ids[k - 1])


(n, k) = [int(x) for x in input().split()]
idt = input().split()
cont = 0
i = 1
while i <= n:
	cont += i
	if k <= cont:
		cont -= i
		break
	i += 1
ach = k - cont
print(idt[ach - 1])


(n, k) = map(int, input().split())
names = list(map(int, input().split()))
i = 1
while k > i:
	k -= i
	i += 1
print(names[k - 1])


quant = input().split(' ')
seq = input().split(' ')
quer = int(quant[1])
cont = 1
numb = 2
teste = True
while teste:
	if quer == 1:
		print(seq[0])
		teste = False
	elif cont + numb >= quer:
		print(seq[quer - cont - 1])
		teste = False
	else:
		cont += numb
		numb += 1


from math import sqrt
(n, k) = map(int, input().split())
li = list(map(int, input().split()))
j = (sqrt(8 * k + 1) - 1) / 2
if j == int(j):
	l = int(j)
	print(li[l - 1])
else:
	j = int(j)
	f = j * (j + 1) // 2
	print(li[k - f - 1])


(n, k) = map(int, input().split())
robotsId = input().split(' ')
i = 0
while i <= n:
	if k > i:
		k -= i
		i += 1
	else:
		break
print(robotsId[k - 1])


(n, k) = map(int, input().split())
i = list(map(int, input().split()))
x = int((2 * k) ** 0.5) - 1
while (x + 1) * (x + 2) // 2 < k:
	x += 1
k -= x * (x + 1) // 2
print(i[k - 1])


def triangular_numbers(N):
	triangulars = [0, 1]
	i = 2
	k = triangulars[-1]
	while k < N:
		k += i
		triangulars.append(k)
		i += 1
		k = triangulars[-1]
	return triangulars

def binary_search(arr, item):
	(low, high) = (0, len(arr))
	while high > low + 1:
		mid = (low + high) // 2
		if arr[mid] == item:
			return mid
		elif arr[mid] > item:
			high = mid
		elif arr[mid] < item:
			low = mid
	return low

def kth_identifier(n, k, items):
	tris = triangular_numbers(3000000000)
	ix = binary_search(tris, k)
	if tris[ix] > k:
		while tris[ix] > k:
			ix -= 1
	if tris[ix] == k:
		return items[ix - 1]
	if tris[ix] < k:
		kth = k - tris[ix]
		return items[kth - 1]

def main():
	(n, k) = [int(i) for i in input().strip().split()]
	items = [int(i) for i in input().strip().split()]
	ans = kth_identifier(n, k, items)
	print(ans)
main()


from sys import stdin
(num, ind) = map(int, stdin.readline().split())
a = list(map(int, stdin.readline().split()))
triangularNumSize = 1
while triangularNumSize < ind:
	ind -= triangularNumSize
	triangularNumSize += 1
print(a[ind - 1])


from sys import stdin as Si
from math import floor as F
from collections import defaultdict as dt
from operator import itemgetter as ig
from math import pi
(N, k) = map(int, Si.readline().split())
Id = list(map(int, Si.readline().split()))
p = 0
if k == 1:
	print(Id[0])
elif 1 < k <= 3:
	print(Id[:2][k % 2])
elif 3 < k <= 6:
	print(Id[:3][k % 3 - 1])
else:
	(n, p, lp) = (4, 6, 4)
	while p < k:
		lp = p
		p = int(n * (n + 1) / 2)
		n += 1
	print(Id[:n][k - lp - 1])


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
ans = []
c = 0
if n == 1:
	print(a[0])
	exit(0)
for i in range(1, n + 1):
	c += i
	ans.append(c)
ans.append(ans[-1] + ans[-2])
for x in range(len(ans) - 1):
	if ans[x] == k:
		print(a[x])
		exit(0)
	elif ans[x] < k < ans[x + 1]:
		print(a[k - ans[x] - 1])
		exit(0)


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
i = 0
c = 0
t = k
while k > i:
	k = k - i
	i += 1
print(a[k - 1])


(n, k) = map(int, input().split())
s = [int(i) for i in input().split()]
d = [0 for i in range(n)]
c = 0
l = 0
for i in range(n):
	if k <= c:
		l = i
		break
	else:
		c += i + 1
c -= l
print(s[k - c - 1])


import math
import os
import random
import re
import sys
import functools
from operator import itemgetter, attrgetter
from collections import Counter
Y = lambda : list(map(int, input().split()))
P = lambda : map(int, input().split())
(n, k) = P()
(s, i, a) = (0, 1, Y())
while s + i < k:
	s += i
	i += 1
print(a[k - s - 1])


(n, k) = map(int, input().split())
A = list(map(int, input().split()))
h = 0
for i in range(1, n + 1):
	if i * (i + 1) // 2 == k:
		print(A[i - 1])
		h = 1
		break
	elif i * (i + 1) // 2 > k:
		break
if h != 1:
	s = i * (i - 1) // 2
	if k == 1:
		print(A[0])
	else:
		k = k % s
		print(A[max(0, k - 1)])


class GameOfRobots:

	def __init__(self, n, k, identifiers):
		self.n = n
		self.k = k
		self.identifiers = identifiers

	def playTheGame(self):
		i = 1
		temp = 0
		while True:
			s = self.totalSum(i)
			if s >= self.k:
				break
			else:
				temp = s
				i += 1
		print(self.identifiers[self.k - temp - 1])

	def totalSum(self, i):
		return int(i * (i + 1) / 2)
(n, k) = [int(i) for i in input().split()]
identifiers = [int(i) for i in input().split()]
gameOfRobots = GameOfRobots(n, k, identifiers)
gameOfRobots.playTheGame()


import sys
import math
import bisect

def solve(A, m):
	n = len(A)
	B = [0] * n
	for i in range(n):
		if i == 0:
			B[i] = 1
		else:
			B[i] = B[i - 1] + i + 1
	p = bisect.bisect_left(B, m)
	if p:
		m -= B[p - 1]
	return A[m - 1]

def main():
	(n, m) = map(int, input().split())
	A = list(map(int, input().split()))
	print(solve(A, m))
main()


(n, k) = [int(x) for x in input().split()]
ids = [int(x) for x in input().split()]
total = 0
for i in range(n):
	if total + (i + 1) < k:
		total += i + 1
	else:
		break
print(ids[k - total - 1])


(n, k) = map(int, input().split())
ids = list(map(int, input().split()))
for robo in range(1, n + 1):
	if k - robo > 0:
		k = k - robo
	else:
		val = ids[k - 1]
		print(val)
		break


r = lambda : map(int, input().split())
(n, k) = r()
rob = list(r())
c = 1
while k - c > 0:
	k -= c
	c += 1
print(rob[k - 1])


(n, k) = [int(i) for i in input().split(' ')]
b = [int(i) for i in input().split(' ')]
a = list(range(1, n + 1))
for i in range(1, n):
	a[i] += a[i - 1]
(l, r) = (0, n)
while r - l > 1:
	m = (l + r) // 2
	if a[m] > k:
		r = m
	else:
		l = m
if k - a[l] > 0:
	print(b[k - a[l] - 1])
else:
	print(b[l])


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
(l, r) = (0, n)
while r - l > 1:
	m = (r + l) // 2
	s = m * (m + 1) // 2
	if s < k:
		l = m
	else:
		r = m
k -= l * (l + 1) // 2
print(a[k - 1])


initialInputSeparated = input().split(' ')
numberOfRobots = int(initialInputSeparated[0])
positionToIdentify = int(initialInputSeparated[1])
robotIdentifiersOrdered = input().split(' ')
pronouncingPositionsOrdered = []
pronouncedPositionsTotal = 1
lastRobotPronounced = 1
while pronouncedPositionsTotal < positionToIdentify:
	pronouncedPositionsTotal += lastRobotPronounced + 1
	lastRobotPronounced += 1
inversePositionInLastRobotPronounced = pronouncedPositionsTotal - positionToIdentify
positionIdentified = list(range(lastRobotPronounced - 1, -1, -1))[inversePositionInLastRobotPronounced]
identifierAsked = robotIdentifiersOrdered[positionIdentified]
print(identifierAsked)


(n, k) = input().split()
n = int(n)
k = int(k)
a = list(map(int, input().split()))
for i in range(1, n + 1):
	res = (1 + i) * i // 2
	if res >= k:
		k = k - (i - 1) * i // 2
		print(a[k - 1])
		break


(n, k) = input().split(' ')
n = int(n)
k = int(k)
d = input().split(' ')
i = 0
while True:
	i += 1
	p = int(i * (i + 1) / 2)
	if k <= p:
		print(d[k - (p - i) - 1])
		break


(n, k) = input().strip().split(' ')
(n, k) = [int(n), int(k)]
a = list(map(int, input().strip().split(' ')))
b = [0 for _ in range(n)]
b[0] = 1
for i in range(1, n):
	b[i] += b[i - 1] + i + 1
for i in range(n):
	if b[i] == k:
		print(a[i])
		break
	elif b[i] > k:
		f = k - b[i - 1]
		print(a[f - 1])
		break


(n, k) = map(int, input().split())
ID = input().split()
v = 1
while k > v:
	k -= v
	v += 1
print(ID[k - 1])


read = input()
n = int(read.split()[0])
k = int(read.split()[1])
row = input()
identifiers = row.split()
index = 0
numeros_falados = 0
for i in range(1, len(identifiers)):
	if numeros_falados + i < k:
		numeros_falados += i
		index += 1
faltam_falar = k - numeros_falados
print(identifiers[faltam_falar - 1])


(n, k) = map(int, input().split())
a = list(map(int, input().split()))
m = 0
l = []
for i in range(1, n + 1):
	m = m + i
	l.append(m)
j = 0
if k == 1:
	print(a[0])
else:
	while 1:
		if l[j] >= k:
			x = k - l[j - 1] - 1
			print(a[x])
			break
		j = j + 1


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
x = round((2 * k) ** 0.5)
x = x - 1
x = x * (x + 1) // 2
print(l[k - x - 1])


import math

def timeToSpeech(s, k):
	robot = int((1 + math.sqrt(-1 + 8 * k)) / 2)
	robotStart = int(robot * (robot - 1) / 2)
	index = k - robotStart - 1
	return s[index]
[n, k] = map(int, input().split(' '))
seq = input().split(' ')
print(timeToSpeech(seq, k))


import sys, threading, os.path
import string
import collections, heapq, math, bisect
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)

def main():
	if os.path.exists('in.txt'):
		input = open('in.txt', 'r')
	else:
		input = sys.stdin
	(n, k) = list(map(int, input.readline().split()))
	lis = list(map(int, input.readline().split()))
	interv = []
	x = 1
	for i in range(100002):
		x += i
		interv.append(x)
	ind = bisect.bisect(interv, k)
	xx = 0
	for i in range(interv[ind - 1], interv[ind]):
		if i == k:
			break
		else:
			xx += 1
	output = lis[xx]
	if os.path.exists('out.txt'):
		open('out.txt', 'w').writelines(str(output))
	else:
		sys.stdout.write(str(output))
main()


(n, k) = map(int, input().split())
l = list(map(int, input().split()))
k -= 1
for i in range(n):
	if i <= k:
		k -= i
	else:
		print(l[k])
		break
else:
	print(l[k])


(n, k) = map(int, input().split())
dl = list(map(int, input().split()))
n = int(k ** 0.5) - 1
while n * (n + 1) <= 2 * k:
	n += 1
n -= 1
m = k - n * (n + 1) // 2
if m > 0:
	n = m
print(dl[n - 1])


(n, k) = map(int, input().split())
l = input().split()
ans = 1
while k > ans:
	k -= ans
	ans += 1
print(l[k - 1])


k = int(input().split()[1])
a = (*map(int, input().split()),)
i = 1
while k > i:
	k -= i
	i += 1
print(a[k - 1])


(n, k) = map(int, input().split())
l = [int(i) for i in input().split()]
from math import sqrt as S, ceil as ceil
s = (-1 + S(1 + 8 * k)) / 2
z1 = ceil(s)
z = int(s)
ans = z * (z + 1) // 2
rem = k - ans
if rem == 0:
	print(l[z - 1])
else:
	print(l[rem - 1])


n = list(map(int, input().split()))
d = list(map(int, input().split()))
k = n[1]
m = n[0]
x = 0
for i in range(1, m + 1):
	h = i
	x += i
	if k <= x:
		break
l = k - x + h - 1
print(d[l])


while True:
	v = input().split()
	(n, k) = v
	if 1 <= int(n) <= 10 ** 5 and 1 <= int(k) <= min(2 * 10 ** 9, int(n) * (int(n) + 1) / 2):
		break
n = int(n)
k = int(k)
id = input().split()
soma = 0
for i in range(1, n + 1):
	soma += i
	if soma >= k:
		r = k - (soma - i)
		print(id[r - 1])
		break


(n, k) = map(int, input().split())
idr = list(map(int, input().split()))
cnt = 0
for i in range(1, n + 1):
	cnt += i
	if cnt >= k:
		res = k - (cnt - i) - 1
		print(idr[res])
		break