program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,i,si
    integer(int32):: abc(ichar('a'):ichar('z')), ans(ichar('a'):ichar('z'))
    character(50):: s

    read*, n
    read*, s
    ans(:) = 0
    do si=1,len_trim(s)
        ans(ichar(s(si:si)))=ans(ichar(s(si:si)))+1
    end do

    do i=2,n
        read*, s
        abc(:)=0
        do si=1,len_trim(s)
            abc(ichar(s(si:si)))=abc(ichar(s(si:si)))+1
        end do
        ans(:) = min(ans,abc)
    end do

    do i=ichar('a'),ichar('z')
        do si=1,ans(i)
            write(*,'(a)',advance='no') char(i)
        end do
    end do
    print*,''

end program name