mystery-8

Solve the mystery.  
Input:
String which consists of words(all the characters of any word are lower case letters) and punctuation marks(consists of {'.' , ',' , '?' , '!'}). Also every input string consists of one '*' in it.
It is guaranteed that strings doesn't start or end with space(' ') and only one answer exists for each case.  

Output:
Lower case letter.  

Constrains:
1 ≤ t ≤ 1000
2 ≤ length of string(n) ≤ 100  

Problem Setter : Vinay Kumar

SAMPLE INPUT
7
k! cats s*ack.
ah, s*tan sees natasha!
aibohphobi*
al lets della call ed ste*la.
amy, must i jujitsu *y ma?
aerata pat a*ea.
lollipop i * lol.

SAMPLE OUTPUT
t
a
a
l
m
r
l

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
T=eval(input())
while T>0:
	l = input()
	st=""
	for char in l:
		if char.isalnum() or char=='*':
			st=st+char
	le = len(st)
	for i in range(0,le/2):
		if(st[i]=='*' or st[le-1-i]=='*'):
			if(st[i]=='*'):
				print(st[le-1-i])
			else:
				print(st[i])
	T=T-1


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
t=eval(input())
while t>0:
	s=input()
	r=""
	for i in s:
		if i.isalpha()==True or i=="*":
			r+=i
	#print r,r.index("*"),len(r)
	print(r[len(r)-r.index("*")-1])
	t-=1


t=eval(input())
rem=['.' , ',' , '?' , '!',' ']
while t:
	t-=1
	s=input()
	for i in range(len(rem)):
		s= s.replace(str(rem[i]),"")
			
	idx=s.find("*")
	n=len(s)
	print(s[n-idx-1])


n=eval(input())
N=[]
P=[]
i=0
while i<n:
	a=input()
	N.append(a)
	i+=1
for i in N:
	new=""
	for j in range(len(i)):
		if i[j].isalpha()!=0 or i[j]=='*':
			new+=i[j]
	P.append(new)
for i in P:
	for j in range(len(i)):
		if i[j]=='*':
			print(i[len(i)-1-j])


t=eval(input())
for i in range(0,t):
	s=input()
	s2=""
	wd=""
	tmp1=""
	tmp2=""
	for j in range(0,len(s)):
		if s[j]!=',' and s[j]!='?' and s[j]!='.' and s[j]!='!' and s[j]!=' ':
			s2=s2+s[j]
	for j in range(0,len(s2)/2+1):
		wd=wd+s2[j]
	k=0
	for j in range(len(s2)-1,len(s2)/2-1,-1):
		if s2[j]!=wd[k]:
			tmp1=s2[j]
			tmp2=wd[k]
			break
		else:
			k+=1
	if tmp1=='*':
		print(tmp2)
	else:
		print(tmp1)
			
										

	 
			


t=eval(input())
while t>0:
	s=input()
	s=s.replace("!","")
	s=s.replace("?","")
	s=s.replace(".","")
	s=s.replace(",","")
	s=s.replace(" ","")
	length=len(s)
	i=0
	while(s[i]!='*'):
		   i=i+1
	new=length-i
	print(s[new-1])
	t=t-1


		
		
		


#!/usr/bin/python3

import re

t = int(input())

for _ in range(t):
	line = input()
	line = re.sub('[!.,? ]', '', line)
	result = (len(line) - line.index('*')) - 1
	print((line[result]))



import re
t=eval(input())
for _ in range(t):
	str=input()
	line = re.sub('[.,?!]', '', str)
	str = line.replace(' ','')
	l=len(str)
	p=str.index('*')
	str1=str[::-1]
	print(str1[p])


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
#print 'Hello World!'
t=eval(input())
while t>0:
	s=input()
	r=""
	for i in s:
		if i.isalpha()==True or i=="*":
			r+=i
	#print r,r.index("*"),len(r)
	print(r[len(r)-r.index("*")-1])
	t-=1


t = int(input(""))
punctuation = ['.' , ',' , '?' , '!',' ']

if t>1000 or t<1:
	print('Error: Try Again!')
	t = input("")
else:
	None

j = 0
while j<t:
	s = input("")
	n = len(s)
	if n>=2 and n<=100:
		None
	else:
		print('Enter valid string again')
		s = input("")
	for i in punctuation:
	  s = s.replace(i,"")
	n = len(s)
	pos = s.index('*')
	letter = n - pos -1
	print(s[letter])
	j += 1
 
 


t=int(input())
pun=['.',',','?','!',' ']
for i in range(t):
	strin=list(input())
	for k in pun:
		v=strin.count(k)
		for d in range(v):
			strin.remove(k)
	n=strin.index('*')
	n+=1
	num=len(strin)-n
	print((strin[num]))


N=eval(input());
for k in range(0,N):
	st=input()
	str=""
	ct=0;
	for i in range(0,len(st)):
		if(st[i].isalnum()==1)or st[i]=='*':
			str=str+st[i];

	#print str
	ct=len(str)-1;
	c=""
	for i in range(0,len(str)):
		if(str[i]=='*'):
			c=str[ct];
			break;
		ct=ct-1;

	print(c);    
			
		
		
		
		


t=eval(input())
z=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range(t):
	s=input()
	l1=[]
	l2=[]
	l=len(s)
	clean=""
	for j in range(l):
		if s[j] in z or s[j]=='*':
			clean+=s[j]
	x=len(clean)
	pos=0
	c=0
	for j in clean:
		if j=='*':
			pos=c
			break
		c+=1
	print(clean[x-1-pos])
		
		


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
N = eval(input())

for _ in range(N):
	s = input()
	slist = list(s)
	punc = '.,?! '
	for item in punc:
		while item in slist:
			slist.remove(item)
	srev = slist[::-1]
	for i in range(len(slist)):
		if srev[i] == '*':
			print(slist[i])
			break



t=eval(input())
for x in range(0,t):
	st=input()
	s=''
	q=''
	for e in st:
		if e!=',' and e!='.' and e!='?' and e!='!' and e!=' ':
			s=s+e
	ind=s.index('*')
	q=s[::-1]
	#print s
	#print q
	#print ind
	print(q[ind])
	


for _ in range(eval(input())):
	a=list(input())
	arr=[]
	for item in a:
		if item.isalpha() or item=="*":
			arr.append(item)
	#print ''.join(arr)
	x=arr.index("*")
	if x>(len(arr)-1)/2:
		x=len(arr)-1-x
		print(arr[x])
	else:
		print(arr[::-1][x])