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: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

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