Algorithms and Data Structures

Find the tail of the given linked list

Given a linked list, you are asked to find the tail and print its value.

Input

The input is read automatically. You donโ€™t need to do anything.

Output

The program should print the value of the tail of the given linked list.

Examples

Input
Output
5 4 2 9 8 -4
-4
ย 

Constraints

Time limit: 0.2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue