read n
read -d "" a
n2=$(( $((2 * n)) - 3))

for x in `seq $((n -1))`
do
	for i in `seq $n2`
	do
		ans="${ans} `echo ${a} | cut -d" " -f${i}-$((i + 2))  | \
			awk '{for(i=1;i<=NF;i++) print $i}' | sort | awk 'NR==2 {print $i}'`"
	done
	a=$ans
	ans=""
	n2=$((n2 - 2))
done
echo $a
