**Problem Description**

Each step it’s allowed to move the box in four directions. The movement is defined as picking one of the the four edges of the box on the ground and rotate the box 90 degrees around that edge.

Take h=2,n=5,m=4 for example, the box is now “Standing Up” on position (2,3), as the following picture shows.

If you going down in one move , the box is now “Laying down” with the top-left unit touching (3,3). Of course this box can never go out of the plane. So it’s impossible to go right or up in the previous status.

Now given n,m,h, and the box is initially “Standing Up” on position (1,1),your task is to find the minimum steps needed to make the box “Standing Up” on position (n,m), or to determine it’s impossible.

**Input**

There are multiple test cases. Given n,m,h(0<n,m <10,000,000,0<h<10) as described before in one line. Process to end of file.

**Output**

Print the minimum steps needed to make the box “Standing Up” on position (n,m) in one line, or print -1 if it’s impossible.

**Sample Input**

3 3 2 3 2 2

**Sample Output**

8 -1

**Source**

2017绍兴市技能竞赛