local n = io.read("*n")
local k = io.read("*n"
)
io.read("*l")
local towns = {}
for i = 1, n do 
	towns[i] = io.read("*n")
end
io.read("*l")
local visited = {}
local step = 1
local idx = 1
local period
local periodstart
local steps = {}
while(step <= k) do 
	if visited[towns[idx]] then
		period = step - visited[towns[idx]]
		periodstart = visited[towns[idx]]
		break
	end
	visited[towns[idx]] = step
	steps[step] = towns[idx]
	idx = towns[idx]
	step = step + 1
end
if period then 
	local resttimes = k - step
	resttimes = resttimes % period
	print(steps[periodstart + resttimes])
else
	print(idx)
end