// Arup Guha
// 4/29/2025
// Solution to 2025 COP 4516 Team Final Contest Problem: Returning Papers

import java.util.*;

public class papers {
	
	final public static long MOD = 1000000007L;
	final public static int MAX = 301;
	
	public static void main(String[] args) {
	
		// Initialize Pascal's Triangle.
		long[][] c = new long[MAX][MAX];
		for (int i=0; i<MAX; i++) {
			c[i][0] = 1;
			c[i][i] = 1;
		}
		
		// Fill in the triangle.
		for (int i=2; i<MAX; i++)
			for (int j=1; j<i; j++)
				c[i][j] = (c[i-1][j-1] + c[i-1][j])%MOD;
				
		// Process cases.
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		for (int loop=0; loop<nC; loop++) {
		
			// Get input
			int n = stdin.nextInt();
			int att = stdin.nextInt();
			int nPapers = stdin.nextInt();
			int nRet = stdin.nextInt();
			
			// Get numerator under mod.
			long num = (c[att][nRet]*c[n-att][nPapers-nRet])%MOD;
			
			// Run EEA on denominator.
			long[] eea = extendedEuclideanAlgorithm(MOD, c[n][nPapers]);
			
			// What we multiply our numerator by.
			long multBy = (eea[1]+ MOD)%MOD;
			
			System.out.println( (num*multBy)%MOD );
		}
	}
	
 	// Returns b inverse mod a in res[1]. Note - value returned could be negative.
 	// Only works if a and b are ints due to the multiplication in the code.
	public static long[] extendedEuclideanAlgorithm(long a, long b) {
		if (b==0)
			return new long[]{1,0,a};
		else {
			long q = a/b;
			long r = a%b;
			long[] rec = extendedEuclideanAlgorithm(b,r);
			return new long[]{rec[1], rec[0] - q*rec[1], rec[2]};
		}
	}
	
	public static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a%b);
	}
}