puts (gets.chomp + gets.chomp).split('x').map(&:chars).max_by(&:size).size