Longest palindrom

Two friends play a simple game: Each of them writes a string by pressing
at random the lowercase letters of his keyboard. Afterwards, the one
that has the longest palindromic substring in the string just written,
wins. Implement a program to help them to decide who is the winner.

Input

Input is a sequence of cases separated by a blank line. Every case has
two lines, each with a non-empty string consisting only of lowercase
letters. No line has more than 1000 characters.

Output

For every case, print the case number and who wins the game following
the sample output.

Observation

Although the sample input is not random, the rest of input is random.

Problem information

Author: Albert Graells

Generation: 2026-01-25T10:22:48.906Z

© Jutge.org, 2006–2026.
https://jutge.org
