프로그램 명: coci_lozinka
제한시간: 1 초
[요약]
주어진 문자열 중 어느 하나를 뒤집은 문자열이 주어진 문자열에 존재하면 그 문자열의 길이와 가운데 문자를 출력하세요.
Mirko is an evil plotting genius and has gotten hold of a list of all possible passwords for a certain user
account. The first thing he noticed was all the passwords are of odd length. Mirko assumes that the
correct password is the one which can be found in both the original and reverse order in the list. For
example, if the word “tulipan” would be the correct password, the word “napilut” has to also appear in
the list. Given that both words are correct passwords, Mirko will try to use both, one at a time.
Help Mirko discover what the correct password is and output its length and central character.
입력
-
The first line of input contains the integer N (1 ≤ N ≤ 100), the number of possible passwords.
-
Each of the following N lines contains a single word, its length being an odd number greater than 2 and lesser than 14. All characters are lowercase letters of the English alphabet.
출력
The first and only line of output must contain the length of the correct password and its central letter.
The solution will be unique.
입출력 예
input
4
las
god
psala
sal
output
3 a
input
4
kisik
ptq
tttrp
tulipan
output
5 s
Clarification of the first example: The required pair of words is “las” and “sal”. Their length is 3 letters and the central character is 'a'.
Clarification of the second example: The word “kisik” can be found in both the original and reverse order on the list (the word is a palindrome), so it is a valid correct password.
출처:/coci/2013-2014/contest5
요약:ladown21
[질/답]
[제출 현황]
[푼 후(0)]