program dubious_document
  implicit none
  integer       :: n, i, j, k, a(50,26)
  character(50) :: s
  a = 0
  read(*,*) n
  do i = 1, n
    read(*,*) s
    s = trim(adjustl(s))
    do j = 1, len_trim(s)
      k = ichar(s(j:j)) - 96
      a(i,k) = a(i,k) + 1
    end do
  end do
  do i = 1, 26
    k = minval(a(1:n,i))
    if (k.gt.0) then
      do j = 1, k
        write(*,'(a)',advance='no') achar(i+96)
      end do
    end if
  end do
  write(*,*)
end program dubious_document