input1 = gets
patsa = input1.split
input2 = gets
juice = input2.split
a = pasta[0].to_i
b = pasta[1].to_i
c = pasta[2].to_i
d = juice[0].to_i
e = juice[1].to_i
x = a
y = d
if x>b
  x = b
    elsif x>c
      x = c
        else
          x = x
end
if y > e
  y = e
    else
     y = y
end
puts "#{x}+#{y}-50" 