n,d,x = gets.split(" ").map{|str| str.to_i}

stock = Array.new(d){gets.split(" ").map{|str| str.to_i}} #i??\??????????????????i??????????¨????

pos = x
for i in 0..d-2
  prof = 0
  for j in 0..n-1
    bene = (stock[i+1][j]-stock[i][j])*(pos/stock[i][j])
    prof = bene if bene > prof
  end
  pos += prof
end

puts pos