#P7640. [2018年杭电多校]Rikka with Badminton

[2018年杭电多校]Rikka with Badminton

Rikka with Badminton

Problem Description

In the last semester, Rikka joined the badminton club. There are nn students in the badminton club, some of them have rackets, and some of them have balls. Formally, there are aa students have neither rackets nor balls, bb students have only rackets, cc students have only balls, and dd students have both rackets and balls. (a+b+c+d=n)(a+b+c+d=n) This week, the club is going to organize students to play badminton. Each student can choose to take part in or not freely. So there are 2n2^n possible registration status. To play badminton, there must be at least two students who have rackets and at least one students who have balls. So if there aren't enough balls or rackets, the activity will fail. Now, Rikka wants to calculate the number of the status among all 2n2^n possible registration status which will make the activity fail.

Input

The first line contains a single number t(1t103)t(1 \leq t \leq 10^3), the number of testcases. For each testcase, the first line contains four integers a,b,c,d(0a,b,c,d107,a+b+c+d1)a,b,c,d(0 \leq a,b,c,d \leq 10^7,a+b+c+d \geq 1).

Output

For each testcase, output a single line with a single integer, the answer modulo 998244353998244353.

Sample Input

3

1 1 1 1

2 2 2 2

3 4 5 6

Sample Output

12

84

2904

Source

2018 Multi-University Training Contest 9