a=int(input())
b=list();
c=1
for i in range(a):
  b[a]=input()
while(c<a):
  b[0]=list(set(b[0])&set(b[c]))
  c=c+1
for j in b[0]:
  print(b[0])

a197c23fed48d2065babdc54b06ea5d76a69cd4e
<mask token>

<mask token>
for i in range(a):
    b[a] = input()
while c < a:
    b[0] = list(set(b[0]) & set(b[c]))
    c = c + 1
for j in b[0]:
    print(b[0])

a = int(input())
b = list()
c = 1
for i in range(a):
    b[a] = input()
while c < a:
    b[0] = list(set(b[0]) & set(b[c]))
    c = c + 1
for j in b[0]:
    print(b[0])

a=int(input())
b=list();
c=1
for i in range(a):
  b[a]=input()
while(c<a):
  b[0]=list(set(b[0])&set(b[c]))
  c=c+1
for j in b[0]:
  print(b[0])
