loop{
  n = readline.to_i
  exit if n == 0

  word_list = []
  n.times{
    word_list << readline.chomp
  }

  # p word_list

  min_sss = word_list.join
  (0..word_list.size-1).to_a.permutation{|order|
    cur_pos = order.shift
    sss = word_list[cur_pos]
    order.each{|cur_pos|
      next_word = word_list[cur_pos]

      min_length = [sss.length, next_word.length].min

      min_length.downto(0){|l|
        if sss[-l, l] == next_word[0, l]
          sss += next_word[l .. -1]
          break
        end
      }
    }
    # puts "cur:#{sss} min:#{min_sss}"
      
    if sss.length < min_sss.length ||
       (sss.length == min_sss.length && sss < min_sss)
      min_sss = sss
    end
  }
  puts min_sss
}