Dragon#16

Dragon

1 second
64 megabytes
Medium
prb16

A centipede has legs and head. Find the number of legs that a dragon with heads has, given that the total number of heads is and the total number of legs is .

Input

Four numbers: , , , . All numbers do not exceed . It is guaranteed that there is at least one dragon and at least one centipede.

Output

Output the number of legs a dragon has. If the given data is contradictory, output . If there are multiple solutions, output any one of them.

Examples

Example 1

Loading
Loading