Time Limit: 1000 MS    Memory Limit: 65536 K 


Description

A lame knight is located at the bottom-left corner of a n*m chessboard. (n is the height and m is the width) Unlike a healthy knight, a lame knight can only make moves where he goes to the right. The only possible moves are: 1. 2 cells up, 1 cell right; 2. 1 cell up, 2 cells right; 3. 1 cell down, 2 cells right; 4. 2 cells down, 1 cell right. The knight will make one trip, and he wants to maximize the number of visited cells. The knight's starting cell counts toward this number. There is also one restriction for the knight's trip: it must contain each kind of a move at least once, unless it is shorter than 4 moves. If the knight makes less than 4 moves (thus visiting less than 5 cells), his moves are not limited in any way. Return the maximal number of cells the knight can visit during one trip, including the initial cell.

Input

There are many test cases.For each case there is only one line contains two integers n and m. ( 1 <= n,m <= 10^9)

Output

For each test case output the answer on a single line.

Sample Input

100 50 1 1 17 5 2 4 20 4

Sample Output

48 1 4 2 4

Source

TopCoder SRM 380