




"""simple docstring"""
import unittest
from pathlib import Path

from transformers import is_vision_available, load_tool
from transformers.testing_utils import get_tests_dir

from .test_tools_common import ToolTesterMixin


if is_vision_available():
			from PIL import Image
class      lowerCAmelCase_						(							unittest.TestCase							,							A__				):



							'''simple docstring'''





							def  A__		(				self							)   ->       str:
													__lowerCAmelCase        =       load_tool("""image-captioning"""							)
													self.tool.setup()
													__lowerCAmelCase        =       load_tool("""image-captioning"""  ,							remote=snake_case_							)




							def  A__		(				self							)   ->       Dict:
													__lowerCAmelCase        =       Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""							)							) / """000000039769.png"""							)
													__lowerCAmelCase        =       self.tool(snake_case_							)
													self.assertEqual(snake_case_  ,							"""two cats sleeping on a couch"""							)




							def  A__		(				self							)   ->       Union[str, Any]:
													__lowerCAmelCase        =       Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""							)							) / """000000039769.png"""							)
													__lowerCAmelCase        =       self.remote_tool(snake_case_							)
													self.assertEqual(snake_case_  ,							"""two cats sleeping on a couch"""							)




							def  A__		(				self							)   ->       Optional[Any]:
													__lowerCAmelCase        =       Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""							)							) / """000000039769.png"""							)
													__lowerCAmelCase        =       self.tool(image=snake_case_							)
													self.assertEqual(snake_case_  ,							"""two cats sleeping on a couch"""							)




							def  A__		(				self							)   ->       Tuple:
													__lowerCAmelCase        =       Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""							)							) / """000000039769.png"""							)
													__lowerCAmelCase        =       self.remote_tool(image=snake_case_							)
													self.assertEqual(snake_case_  ,							"""two cats sleeping on a couch"""							)


"""simple docstring"""
from __future__ import annotations
class      lowerCAmelCase_						:



							'''simple docstring'''





							def __init__(				self  ,							snake_case_							)   ->       None:
													__lowerCAmelCase        =       data
													__lowerCAmelCase        =       None
class      lowerCAmelCase_						:



							'''simple docstring'''





							def __init__(				self							)   ->       List[str]:
													__lowerCAmelCase        =       None




							def  A__		(				self  ,							snake_case_							)   ->       int:
													__lowerCAmelCase        =       Node(snake_case_							)
													__lowerCAmelCase        =       self.head
													__lowerCAmelCase        =       new_node
													return self.head.data




							def  A__		(				self							)   ->       int | None:
													__lowerCAmelCase        =       self.head
													__lowerCAmelCase        =       self.head
													if self.head:
																			while fast_pointer and fast_pointer.next:
																									__lowerCAmelCase        =       fast_pointer.next.next
																									__lowerCAmelCase        =       slow_pointer.next
																			return slow_pointer.data
													else:
																			print("""No element found."""							)
																			return None


if __name__ == "__main__":
			SCREAMING_SNAKE_CASE_			      =					LinkedList()
			for _ in range(int(input().strip())):
						SCREAMING_SNAKE_CASE_			      =					int(input().strip())
						link.push(data)
			print(link.middle_element())
