# Gridgedge

Time Limit : 2 sec, Memory Limit : 524288 KB

# Problem D: Gridgedge

## Problem

オ$(0, 0)$A E$(R-1, C-1)$ł$R \times C$}X̃ObhB}X($e$, $f$)ɂƂA$(e+1, f)$, $(e-1, f)$, $(e, f+1)$, $(e, f-1)$, $(e, 0)$, $(e, C-1)$, $(0, f)$, $(R-1, f)$ɂ̓RXg$1$ňړłBObh̊Oɏo邱Ƃ͂łȂB}X$(a_i, a_j)$$(b_i, b_j)ֈړƂAŒZoH̃RXgƁAŒZoH̑gݍ킹̑10^9 + 7Ŋ]vZB AoH̑gݍ킹͈ړ̕@ɂċʂ̂ƂBƂ΁Aݒn(100, 1) ̂ƂA (100, 0)ɍŒZRXgōsɂ͏L(e, f-1)$$(e, 0)$ōsƂł̂ŁA$2$ʂƐB

## Input

͈͂ȉ̌ŗ^B

$R$ $C$ $a_i$ $a_j$ $b_i$ $b_j$


## Constraints

͈͂ȉ̏𖞂B

• $1 \le R, C \le 500$
• $0 \le a_i, b_i \le R - 1$
• $0 \le a_j, b_j \le C - 1$
• ^͂͑SĐłB

## Output

}X$(a_i, a_j)$$(b_i, b_j)$ֈړƂAŒZoH̃RXgƁAŒZoH̑gݍ킹̑$10^9+7$Ŋ]󔒋؂$1$sɏo͂B

## Sample Input 1

2 2 0 0 1 1


## Sample Output 1

2 8


## Sample Input 2

1 1 0 0 0 0


## Sample Output 2

0 1


## Sample Input 3

1 10 0 0 0 9


## Sample Output 3

1 1


## Sample Input 4

5 5 0 0 4 4


## Sample Output 4

2 2


## Sample Input 5

421 435 196 169 388 9


## Sample Output 5

43 917334776
`