integer N
character(50) S
integer abc(ichar("a"):ichar("z")),ans(ichar("a"):ichar("z"))
read*,N
ans=0
read*,S
do j=1,len_trim(S)
  ans(ichar(S(j:j)))=ans(ichar(S(j:j)))+1
end do
do i=2,N
  read*,S
  abc=0
  do j=1,len_trim(S)
    abc(ichar(S(j:j)))=abc(ichar(S(j:j)))+1
  end do
  do j=ichar("a"),ichar("z")
    ans(j)=min(ans(j),abc(j))
  end do
end do
S=""
do i=ichar("a"),ichar("z")
  S=trim(S)//repeat(char(i),ans(i))
end do
print"(A)",trim(S)
end