Average and Median

No attempts yetTime limit1sMemory limit128 MB

Problem

The average of three integers $A$, $B$, and $C$ is $(A+B+C)/3$. The median of three integers is the middle value when the three numbers are sorted in increasing order.

Given two integers $A$ and $B$, write a program that finds the smallest integer $C$ such that the average and the median of $A$, $B$, and $C$ are equal.

Input

The input consists of several test cases. Each test case is given on a single line with two integers $A$ and $B$. ($1 \le A \le B \le 10^9$)

The last line of the input contains two zeros, and this line is not processed.

Output

For each test case, print the answer on its own line.