program ABC058C
    implicit none
    integer(8)::n,i,j,tail
    integer(8),dimension(26)::li,L
    character(10000)::out
    character(50)::S
    read(5,*)n
    L=0

    do i=1,n
        li=0
        read(5,*)S
        do j=1,len_trim(S)
            li(ichar(S(j:j))-96)=li(ichar(S(j:j))-96)+1
        end do

        do j=1,26
            if(i==1)then
                L(j)=li(j)
            else
                L(j)=min(li(j),L(j))
            end if
        end do
    end do

    tail=1
    do i=1,26
        do j=1,L(i)
            out(tail:tail)=char(i+96)
            tail=tail+1
        end do
    end do
    print'(A)',out(1:tail-1)
end program ABC058C