eolymp
bolt
Try our new interface for solving problems
Problems

Word the champion

Word the champion

Some offer in unknown language is set. We shall name a word in it the champion if it is палиндромом and the quantity of letters in it is maximal. Letters of the alphabet in unknown language are letters of the latin alphabet and the Arabian figures. It is guaranteed that in the sentence, there are no other characters except for letters, spaces, punctuation marks and non-letter hyphens (minus) and apostrophes.

Input

The offer in unknown language.

Output

Number of a word of the champion.

Time limit 0.5 seconds
Memory limit 64 MiB
Input example #1
Oo, it aaa is not bb.
Output example #1
3
Input example #3
Oo, it aaa issi not bbbbb.           
Output example #3
6