
'''simple docstring'''


from __future__ import annotations

class 		__lowercase			:

			def __init__(self     ,				A ):
								lowerCamelCase_   : Any       =						data
								lowerCamelCase_   : int       =						None




class 		__lowercase			:

			def __init__(self ):
								lowerCamelCase_   : List[str]       =						None

			def     UpperCAmelCase__	(self     ,				A ):
								lowerCamelCase_   : Dict       =						Node(__lowerCAmelCase )
								lowerCamelCase_   : int       =						self.head
								lowerCamelCase_   : Dict       =						new_node
								return self.head.data






			def     UpperCAmelCase__	(self ):
								lowerCamelCase_   : Dict       =						self.head
								lowerCamelCase_   : Dict       =						self.head
								if self.head:
													while fast_pointer and fast_pointer.next:
																		lowerCamelCase_   : Any       =						fast_pointer.next.next
																		lowerCamelCase_   : int       =						slow_pointer.next
													return slow_pointer.data
								else:
													print('''No element found.''' )
													return None


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




'''simple docstring'''


def lowercase_		(				_lowercase			)       ->							int:
					'''simple docstring'''

					if not isinstance(_lowercase     ,    _lowercase			):
										raise TypeError('''recursive_lucas_number accepts only integer arguments.'''			)
					if n_th_number == 0:
										return 2
					if n_th_number == 1:
										return 1

					return recursive_lucas_number(n_th_number - 1			) + recursive_lucas_number(
					    n_th_number - 2			)




def lowercase_		(				_lowercase			)       ->							int:
					'''simple docstring'''

					if not isinstance(_lowercase     ,    _lowercase			):
										raise TypeError('''dynamic_lucas_number accepts only integer arguments.'''			)
					lowerCamelCase_, lowerCamelCase_   : List[Any]       =						2, 1
					for _ in range(_lowercase			):
										lowerCamelCase_, lowerCamelCase_   : Dict       =						b, a + b
					return a


if __name__ == "__main__":
					from doctest import testmod

					testmod()
					__lowercase							:				Any					=       int(input('''Enter the number of terms in lucas series:\n''').strip())
					print('''Using recursive function to calculate lucas series:''')
					print(''' '''.join(str(recursive_lucas_number(i)) for i in range(n)))
					print('''\nUsing dynamic function to calculate lucas series:''')
					print(''' '''.join(str(dynamic_lucas_number(i)) for i in range(n)))


