n = gets.split(" ").map(&:to_i)
m = gets.split(" ").map(&:to_i)
ary = []

for i in 1..n.length-1
  if i % 2 != 0
    res = n[i]*100+n[i+1]
    ary.push(res)
  end
end

for s in 1..m.length-1
  if s % 2 != 0
    res = m[s]*100+m[s+1]
    ary.push(res)
  end
end
ary = ary.sort.uniq
arynew = []

for i in 0..ary.length-1
  arynew.push(sprintf("%03d" ,ary[i]))
  arynew[i].insert(-3, ":")
end

puts arynew.join(" ")