The mean of three integers A, B and C is (A + B + C)/3. The median of three integers is the one that would be in the middle if they are sorted in non-decreasing order. Given two integers A and B, return the minimum possible integer C such that the mean and the median of A, B and C are equal.
Each test case is given in a single line that contains two integers A and B (1 ≤ A ≤ B ≤ 109). The last test case is followed by a line containing two zeros.
For each test case output one line containing the minimum possible integer C such that the mean and the median of A, B and C are equal.
Sample Input | Sample Output |
1 2 |
0 |