program A319C
    implicit none
    integer(8)::n,i,j
    integer(8),dimension(26)::A,B
    character(50)::S
    A=0
    read*,n
    do i=1,n
        read*,S
        B=0
        do j=1,len_trim(S)
            B(ichar(S(j:j))-96)=B(ichar(S(j:j))-96)+1
        end do

        if(i==1)then
            A=B
        else
            do j=1,26
                A(j)=min(A(j),B(j))
            end do
        end if
    end do

    do i=1,26
        do j=1,A(i)
            write(*,fmt='(A)',advance='no')char(i+96)
        end do
    end do
    print'(A)',""
end program A319C