Ralph has a magic field which is divided into *n* × *m* blocks. That is to say, there are *n* rows and *m* columns on the field. Ralph can put an integer in each block. However, the magic field doesn't always work properly. It works only if the product of integers in each row and each column equals to *k*, where *k* is either 1 or -1.

Now Ralph wants you to figure out the number of ways to put numbers in each block in such a way that the magic field works properly. Two ways are considered different if and only if there exists at least one block where the numbers in the first way and in the second way are different. You are asked to output the answer modulo 1000000007 = 10<sup class="upper-index">9</sup> + 7.

Note that there is no range of the numbers to put in the blocks, but we can prove that the answer is not infinity.
The only line contains three integers *n*, *m* and *k* (1 ≤ *n*, *m* ≤ 10<sup class="upper-index">18</sup>, *k* is either 1 or -1).
In the first example the only way is to put -1 into the only block.

In the second example the only way is to put 1 into every block.
1 1 -1
1
1 3 1
1
3 3 -1
16
2 7 1
64
1 1 1
1
2 4 -1
8
173 69 -1
814271739
110 142 1
537040244
162 162 -1
394042552
49 153 -1
412796600
94 182 1
33590706
106666666 233333333 1
121241754
2 2 1
2
146 34 -1
742752757
94 86 -1
476913727
2529756051797760 2682355969139391 -1
0
3126690179932000 2474382898739836 -1
917305624
3551499873841921 2512677762780671 -1
350058339
3613456196418270 2872267429531501 1
223552863
2886684369091916 3509787933422130 1
341476979
3536041043537343 2416093514489183 1
394974516
2273134852621270 2798005122439669 1
901406364
2870150496178092 3171485931753811 -1
0
999999999999999999 1000000000000000000 1
102810659
987654321987654321 666666666666666666 1
279028602
1 2 -1
0
2 1 -1
0
1000000000000000000 1 1
1
1000000006 100000000000000000 1
123624987
def f(no):
    if(no==0):
        return 1
    elif(no%2==1):
        return (2*f(no-1))%1000000007
    else:
        tmp=f(no/2)
        return (tmp*tmp)%1000000007

n,m,k=input().split()
n=int(n)
m=int(m)
k=int(k)
if(n%2!=m%2 and k==-1):
    print(-1)
else:
    print(f((n-1)*(m-1)))