indiahacks-pb-2

Mohit has a possible list of passwords of Rohit's hackerearth account. All passwords length is odd. But Mohit knows that Rohit is a big fan of palindromes. So, his password and reverse of his password both should be in the list.

You have to print the length of Rohit's password and it's mid character.

Note : The solution will be unique.

INPUT 
The first line of input contains the integer N, 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.

OUTPUT 
The first and only line of output must contain the length of the correct password and its central letter.

CONSTRAINTS 
1 ≤ N ≤ 100

SAMPLE INPUT
4
abc
def
feg
cba

SAMPLE OUTPUT
3 b

Source: hackerearth | Difficulty: EASY


Solutions:
noOfStrings = int(input())
slist = {}
for sno in range(1, noOfStrings+1):
	s = input()
	if((s[::-1] in slist) == True):
		print(str(len(s)) + " " + s[len(s)/2])
	else:
		slist[s] = 1


l = []
for i in range(eval(input())):
	l.append(input())
for i in range(len(l)-1):
	for j in range(i,len(l)):
		
		if l[i][::-1] == l[j]:
			
			print(len(l[i]), l[i][len(l[i])/2])
			break



from sys import stdin
from itertools import combinations

def main():
	nextitem = iter(stdin.read().split()).__next__
	n = int(nextitem())
	arr = [nextitem() for _ in range(n)]
	for x, y in combinations(arr, 2):
		if x == y[::-1]:
			print(len(x), x[len(x) // 2])
			break

main()


a=[]
c=[]
for i in range (eval(input())):
	a.append(input())
for i in range(len(a)):
	temp=a[i]
	if temp[::-1] in c:
		print('%d %s'%(len(temp),temp[(len(temp)/2)]))
	else:
		c.append(temp)


allPass = {}
for _ in range(eval(input())):
	curr = input().strip()
	rcur = curr[::-1]
	if rcur in allPass:
		print("%d %s" % (len(curr), curr[len(curr)//2]))
		break
	allPass[curr] = True
	


t = int(input())
strings = []
for x in range(t):
	strings.append(input())

for i, x in enumerate(strings):
	for j, y in enumerate(strings):
		if i != j and x == ''.join(reversed(y)):
			print(' '.join(map(str, [len(x), x[len(x) / 2]])))
			raise SystemExit


noOfStrings = int(input())
slist = {}
for sno in range(1, noOfStrings+1):
	s = input()
	if((s[::-1] in slist) == True):
		print(str(len(s)) + " " + s[len(s)/2])
	else:
		slist[s] = 1


def rev(s):
	s1=''
	for i in range(len(s)):
		s1=s1+s[len(s)-1-i]
	return s1
a=[]
for _ in range(int(input())):
	a.append(input())
flag=0
for __ in range(len(a)):
	c=a[__]
	if rev(c) in a:
		temp=c
		flag=1
		break
if flag==1:
	l=len(temp)
	m=l
	m=(m/2)
	print(str(l)+" "+c[m])

		
	
	


t = int(input())
arr = []
for i in range(t):
	a = input()
	flag = 0
	b=''.join(reversed(a))
	for j in arr:
		if j == b:
			flag = 1
			break
	if flag == 0:
		arr.append(a)
	if flag == 1:
		print(len(a),a[(len(a))/2],'\n')


n = input()
n = int(n)
P = []
for x in range(n):
	new = input()
	P.append(new)
	
	if(new[::-1] in P):
		print(len(new),new[int(len(new)/2)])
		break

	else:
		continue
	


a = []
n = int(input())
for _ in range(n):
	a.append(input())
for i in a:
	if i[::-1] in a:
		print(len(i), i[len(i)/2])
		break
	
	
	


n = input()
n = int(n)
P = []
for x in range(n):
	new = input()
	P.append(new)
	
	if(new[::-1] in P):
		print(len(new),new[int(len(new)/2)])
		break

	else:
		continue
	


n = input()
n = int(n)
P = []
for x in range(n):
	new = input()
	P.append(new)
	
	if(new[::-1] in P):
		print(len(new),new[int(len(new)/2)])
		break

	else:
		continue
	


n = int(input())
arr = [input().strip() for _ in range(n)]
for x in range(n):
	for y in range(x + 1, n):
		if arr[x] == arr[y][::-1]:
			print(len(arr[x]), arr[x][len(arr[x]) // 2])
			break



def rev(s):
	s1=''
	for i in range(len(s)):
		s1=s1+s[len(s)-1-i]
	return s1
	
a=[]
for i in range(int(input())):
	a.append(input())
flag=0
for j in range(len(a)):
	if rev(a[j]) in a:
		flag=1
		temp=a[j]
		l=len(a[j])
		break;
if flag==1:
	print(str(l)+" "+temp[l/2])


t=int(input())
h=[]
ans=""
for i in range(0,t):
	h1=input();
	if h1[::-1] in h:
		ans=h1
	else:
		h.append(h1)
print(str(len(ans))+" "+ans[len(ans)/2])



allPass = {}
for _ in range(eval(input())):
	curr = input().strip()
	rcur = curr[::-1]
	if rcur in allPass:
		print("%d %s" % (len(curr), curr[len(curr)//2]))
		break
	allPass[curr] = True
	


n=eval(input())
s=[]
for i in range(n):
	temp=input()
	s.append(list(temp))
s2=[]
for i in range(len(s)):
    temp=[]
    for j in range(1, len(s[i])+1):
        temp.append(s[i][-j])
    s2.append(''.join(temp))
for i in range(len(s)):
    s[i]=''.join(s[i])
a= set(s).intersection(set(s2))
b=(a.pop())
print(len(b), b[len(b)/2])
	
	


d = set()
for _ in range(int(input())):
	r = input()
	if r[::-1] in d:
		l = len(r)
		print(l, r[l/2])
	d.add(r)


N = int(input())
d = {}
ans = ""
l = 0
for i in range(N):
	s = input()
	if s[::-1] in d:
		l = len(s)
		ans = s[len(s)/2]
	d[s] = True
print(l, ans)
	



n = eval(input())

l = []
found = False
for i in range(n):
	s = input()
	if found:
		continue
	if s in l:
		ans = str(len(s)) + ' ' + s[len(s) / 2]
		found = True
	else:
		rev_s = s[::-1]
		l.append(rev_s)

print(ans)