acronym-2

See Russian Translation

W.T.H.S.E.C

Confused? Well it stands for Welcome To HackerEarth September Easy Challenge :). It's quite amazing when long words like this get reduced to such a short string. They sound pretty cool and often make the chat interesting. They are almost used everywhere these days.

Our friend Harsh has been recently reducing every sentence he receives to acronym. Since Harsh is a young lad he has his own personal likes and dislikes. There are some words which he just does not want to see in a sentence. So whenever he encounters such a word he simply ignores it. Harsh is thinking of converting a book to an acronym book where each sentence of the book is reduced to its short form. Since Harsh is quite busy in promoting his new book he wants you to help him in doing so.

So he gives you a set of words which he dislikes and a sentence for which he wants to abbreviate. Help him in getting the required abbreviation.  

Input:

The  first line contains an integer K which denotes the number of disliked words, This is followed by k lines where each line contains a disliked word, the next line will contain an integer donating the number of words in the given sentence, The last line contains the sentence of which Harsh wants to abbreviate.

The sentence will consist of number of words separated by a space 

All words will consist of lowercase English alphabets(a-z) 

Output:

In a single line print the required acronym. The Acronym should be printed in Upper Case English alphabets separated by "." (dots). 

Note:

changing a sentence to acronym means taking first character of each word of the sentence and changing it to upper case then writing the characters separated by "." (dots), remember that Harsh doesn't like some words so he will not take their first character if they appear in the sentence

If a disliked word is present as a proper substring of a word in the given sentence then it should not be ignored.

The final Output will never be an empty string.

Constraints:

1 ≤ K ≤10

1 ≤  length of each word ≤100

1 ≤  length of the sentence ≤100

SAMPLE INPUT
5
hey
girls
i
am
single
11
hey all boys and girls welcome to hackerearth easy september challenge

SAMPLE OUTPUT
A.B.A.W.T.H.E.S.C

Explanation

The required string after ignoring disliked strings would be 

all boys and welcome to hackerearth easy september challenge

So equivalent acronym would be

A.B.A.W.T.H.E.S.C

Source: hackerearth | Difficulty: EASY
Tags: String algorithms

Ad-hoc


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

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
m=[]
for i in range(eval(input())):
	m.append(input())
f=input()
p=list(map(str,input().split()))
p=list(p)

k=[x for x in p if x not in m]
o=[]
for i in k:
	if(i>len(k)):
		ans=i[0].upper()
		o.append(ans)
		
		
print(".".join(o))


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

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
T = int(input())
D = []
for i in range(T):
	D.append(input())
	
L = int(input())
S = input()
Q = S.split(" ")
X = []

for i in range(len(Q)):
	if Q[i] not in D:
		X.append(Q[i][0].upper())

print(".".join(X))


import re
c = eval(input())
final_string = ""
dislike_words = []
for i in range(0,c):
	dislike_words.append(input())
no_of_words = eval(input())
sentence = input().split()
for i in sentence:
	if i not in dislike_words:
		if i != sentence[len(sentence)-1]:
			final_string= final_string + i[0].upper() + "."
		else:
			final_string= final_string + i[0].upper()
if final_string[-1] == ".":
	final_string = final_string[:len(final_string)-1]
print(final_string)


k=int(input())
a=[]
li=[]
lis=[]
for i in range(k):
	a.append(input())
n=int(input())
sen=input()
li=sen.split()
for i in li:
	if i not in a:
		lis.append(i[0].upper())

st='.'.join(lis)
print(st)
		
	


k=int(input())
l=list()
ans=''
while k>0:
	l.append(input())
	k=k-1
m=input()
string=input().split()
for word in string:
	flag=0
	for i in l:
		if word==i:
			flag=1
			break
	if flag==0:
	  ans=ans+word[0].capitalize()+'.'
ans=ans[:-1]
print(ans)


import sys

lis=[]
d=[]
ig=int(input())
for i in range(ig):
	lis.append(input())

i=int(input())
st=input()
flag=1
lis1=st.split(' ',i)

for i in lis1:
	if i in lis:
		'''nothing'''
	else:
		if flag:
			sys.stdout.write(i[0].upper())
			flag=0
		else:
			sys.stdout.write('.'+i[0].upper())
		



'''
Created on Sep 7, 2015

@author: BGH38711
'''
n = int(input())
i = 1;
w = list()
while n!=0:
	w.insert(i, input())
	i=i+1
	n=n-1
k = int(input())
sentence = input()
spl_sentence = sentence.split()

acr = list()
index =0;

for i in spl_sentence:
	if i not in w:
		acr.insert(index, i)
		index=index+1

#print len(acr)
final_acr=""
for i in range(0,len(acr)):
	final_acr = final_acr+acr[i][0].upper().strip()+"."
	
print(final_acr.strip("."))
'''
for j in spl_sentence:
	for i in w:
		if w[i] != j:
			acr.insert(index, j)
			index=index+1
		else:
			print "No"
'''
#print len(w)
#print acr


s=[]
st=''
for i in range(eval(input())):
	    s.append(input())	
t=eval(input())
a=input().split()
for ch in a:
		if ch not in s:
				st+=ch[0].upper()+'.'				
print(st[:-1])

			    
	    


disliked_num = int(input().strip())
disliked = []
for i in range(disliked_num):
	disliked.append(input().strip())
words_num = int(input().strip())
words = input().strip().split(" ")
out = []
for word in words:
	if not (word in disliked):
		out.append(word[0].upper())
print(".".join(out))


dislikes = []
for _ in range(eval(input())):
	dislikes.append(input().strip())
now = eval(input())
words = input().split()
abbr  = []
for x in words:
	if x in dislikes:
		continue
	else:
		abbr.append(x[0].upper())
print(".".join(abbr))        


dislikes = []
for _ in range(eval(input())):
	dislikes.append(input().strip())
now = eval(input())
words = input().split()
abbr  = []
for x in words:
	if x in dislikes:
		continue
	else:
		abbr.append(x[0].upper())
print(".".join(abbr))        
	


import sys
n = int(input())
storage = []
for i in range(n):
	word = input()
	storage.append(word)

num = int(input())
line = input().split()
first = 1
for word in line:
	if word not in storage and first:
		sys.stdout.write(word[0].upper())
		first = 0
	elif word not in storage:
		sys.stdout.write("." + word[0].upper())


import re
c = eval(input())
final_string = ""
dislike_words = []
for i in range(0,c):
	dislike_words.append(input())
no_of_words = eval(input())
sentence = input().split()
for i in sentence:
	if i not in dislike_words:
		if i != sentence[len(sentence)-1]:
			final_string= final_string + i[0].upper() + "."
		else:
			final_string= final_string + i[0].upper()
if final_string[-1] == ".":
	final_string = final_string[:len(final_string)-1]
print(final_string)




k = int(input())
a = []
for i in range(k) :
	c = input()
	a.append(c)
	
z = int(input())
	
s = input().split(' ')

s = [i for i in s if i not in a]

for q in s :
	print(q[0].upper(),end='')
	if s.index(q) != len(s) - 1 :
		print('.',end='')
	




d_arr = []
for _ in range(int(input())):
	d_arr.append(input())
n = int(input())
arr = input().split()
res = []
for i in arr:
	if i not in d_arr:
		res.append(i[0].upper())
print(".".join(res))



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

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
dislikeNum = int(input())
dislike=[]
for x in range(0,dislikeNum):
	dislike=dislike+[input()]
words = int(input())
sentences = input().split()
string=''
for word in sentences:
	if word not in dislike:
		string=string+'.'+word[0].upper()
if len(string)<2:
	print('.')
else :
	print(string[1:])


	


k = int(input())
words = []
for i in range(k):
	words.append(input())
y = int(input())
frase = input().split(" ")
result = []
for w in frase:
	if w not in words:
		result.append(w[0].upper())
		result.append('.')
del result[-1]
print("".join(result))



'''
# 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!'
n=eval(input())
l2=[]
while n>0:
	t=input()
	if t=="":
		n=n+1
	else:
		l2.append(t)
	n=n-1
#print l2
b=eval(input())
t1=input()
l1=t1.split()
l3 = [x for x in l1 if x not in l2]
bb=[]
for i in l3:
	bb.append(i[0].upper())
sa=".".join(bb)
	
print(sa)


n= eval(input())
st=[]
j=0
for j in range(0,n):
	c=str(input())
	st.append(c)
l= eval(input())
st2=str(input())
st2=st2
lst=st2.split(" ")
for j in range(0,n):
	for i in range(0,len(lst)):
		if lst[i]==st[j]:
			lst[i]=''
ans=""
#print lst
for i in lst:
	if i !='':
		ans=ans+i.upper()[0]+'.'
print(ans[:-1])
#print 'Hello World!'