"""simple docstring"""







from __future__ import annotations


class      _lowercase						:

				def __init__(       self    :      List[str]    ,      _lowercase    :      int       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						data
										UpperCAmelCase__   		=						None


class      _lowercase						:

				def __init__(       self    :      Optional[Any]       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						None

				def     A	(       self    :      Any    ,      _lowercase    :      int       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						Node(_lowercase       )
										UpperCAmelCase__   		=						self.head
										UpperCAmelCase__   		=						new_node
										return self.head.data

				def     A	(       self    :      Optional[int]       ):


										'''simple docstring'''
										UpperCAmelCase__   		=						self.head
										UpperCAmelCase__   		=						self.head
										if self.head:
																while fast_pointer and fast_pointer.next:
																						UpperCAmelCase__   		=						fast_pointer.next.next
																						UpperCAmelCase__   		=						slow_pointer.next
																return slow_pointer.data
										else:
																print("""No element found."""       )
																return None


if __name__ == "__main__":
						UpperCamelCase_    :    Tuple											=						LinkedList()
						for _ in range(int(input().strip())):
												UpperCamelCase_    :    List[str]											=						int(input().strip())
												link.push(data)
						print(link.middle_element())


"""simple docstring"""







from __future__ import annotations

from collections import Counter


def 					a__ (						UpperCAmelCase__    :     int     )->		list[int]:
						UpperCAmelCase__   		=						[True] * n
						UpperCAmelCase__   		=						False
						UpperCAmelCase__   		=						False
						UpperCAmelCase__   		=						True

						for i in range(3						,     int(n**0.5 + 1     )						,     2     ):
												UpperCAmelCase__   		=						i * 2
												while index < n:
																		UpperCAmelCase__   		=						False
																		UpperCAmelCase__   		=						index + i

						UpperCAmelCase__   		=						[2]

						for i in range(3						,     UpperCAmelCase__						,     2     ):
												if is_prime[i]:
																		primes.append(UpperCAmelCase__     )

						return primes


def 					a__ (						UpperCAmelCase__    :     int     )->		list[list[int]]:
						UpperCAmelCase__   		=						str(UpperCAmelCase__     )
						UpperCAmelCase__   		=						[]
						UpperCAmelCase__   		=						["""0""", """1""", """2""", """3""", """4""", """5""", """6""", """7""", """8""", """9"""]

						for duplicate in Counter(UpperCAmelCase__     ) - Counter(set(UpperCAmelCase__     )     ):
												UpperCAmelCase__   		=						[int(number_str.replace(UpperCAmelCase__						,     UpperCAmelCase__     )     ) for digit in digits]
												replacements.append(UpperCAmelCase__     )

						return replacements


def 					a__ (						UpperCAmelCase__    :     int = 8     )->		int:
						UpperCAmelCase__   		=						set()

						# Filter primes with less than 3 replaceable digits
						UpperCAmelCase__   		=						{
						    x for x in set(prime_sieve(1_0_0_0_0_0_0     )     ) if len(str(UpperCAmelCase__     )     ) - len(set(str(UpperCAmelCase__     )     )     ) >= 3
						}

						for prime in primes:
												if prime in numbers_checked:
																		continue

												UpperCAmelCase__   		=						digit_replacements(UpperCAmelCase__     )

												for family in replacements:
																		numbers_checked.update(UpperCAmelCase__     )
																		UpperCAmelCase__   		=						primes.intersection(UpperCAmelCase__     )

																		if len(UpperCAmelCase__     ) != family_length:
																								continue

																		return min(UpperCAmelCase__     )

						return -1


if __name__ == "__main__":
						print(solution())

