N=int(input())
s=[input() for i in range(N)]
M=int(input())
l=[input() for i in range(M)]
list_str=list(dict.fromkeys(s+l))
s_l=[]
for i in range(len(list_str)):
  s_l.append(s.count(list_str[i])-l.count(list_str[i]))
print(all([i < 0 for i in s_l]))
if(all([i < 0 for i in s_l])):
  t='a'
  while(t==any(s_l)):
    t+='a'
  print(t)
else:print(max(s_l))