const main = stdin => {
  const input = stdin.trim().split('\n')
  const R = input[0].split('\n').map(x => parseInt(x))
  const G = input[1].split('\n').map(x => parseInt(x))

  console.log(2 * G - R)
}
// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))
