After Chef successfully built a modern (L, K)-window on the attic wall he decided to expand the notion of the (L, K)-window in some other areas. Now he considers a rectangular grid that contains only zeroes and ones and has size N x M. He considers the (L, K)-window here as any submatrix of size L x K that contains only ones. Formally he defines (L, K)-window as any (K+L)-tuple (R1, ..., RL, C1, ..., CK) such that 1 <= R1 < ... < RL <= N, 1 <= C1  < ... < CK <= M and A[Ri][Cj]=1 for all 1 <= i <= L, 1<= j <= K. Here A[r][c] is the c-th element of the r-th row of considered rectangular grid.

Why does Chef call some (K+L)-tuple of numbers by the window? Just mark all points (Ri,Cj) (1 <= i <= L, 1<= j <= K) on the plane and join by line segments all pairs of points that has equal abscises or ordinates and you will see that this picture is like a window.

Now Chef considers some particular N x M grid and wants to calculate the total number of (L, K)-windows in this rectangular grid. Help him. Since this number can be very large calculate the result modulo 1000000080798150871.


Input
 The first line contains a single positive integer T <= 100, the number of test cases. T test cases follow. The first line of each test case contains four positive integers N, M, L, K, where L, N <= 1000, K, M <=3. Next N lines describe the rectangular grid considered by Chef. Each of these lines contains M symbols. Every symbol is either one or zero.


Output
 For each test case, output a single line containing the total number of (L, K)-windows for the given grid modulo 1000000080798150871.


Example

Input:
2
3 2 2 1
11
01
10
3 3 2 2
111
101
111

Output:
2
5


Explanation
In the first case it is just the number of pairs of cells with value 1 that have the same column number.

In the second case we have the following (2, 2)-windows:

(First row, Second row, First column, Third column)

(First row, Third row, First column, Second column)

(First row, Third row, First column, Third column)

(First row, Third row, Second column, Third column)

(Second row, Third row, First column, Third column)
#!/usr/bin/python
mainlis=[]
maxv=1000000080798150871
for i in range(0,1000,1):
  mainlis.append([])
  varlis=mainlis[i]	
  for j in range(0,3,1):
    varlis.append(0)	
test=input()
while test >0:
  string=raw_input()
  lis=string.split()
  n=int(lis[0])
  m=int(lis[1])
  l=int(lis[2])
  k=int(lis[3])
  for i in range(0,n,1):
    string=raw_input()
    varlis=mainlis[i]	
    for j in range(0,m,1):
      varlis[j]=int(string[j])
  if m==1:
    count=0
    for i in range(0,n,1):
      varlis=mainlis[i]
      if varlis[0]==1:
        count=count+1
    ans=1
    for i in range(0,l,1):
      ans=(ans*(count-i))/(i+1)
  elif m==2:
    if k==2:
      count=0
      for i in range(0,n,1):
        varlis=mainlis[i]
        if varlis[0]==1 and varlis[1]==1:
          count=count+1
      ans=1
      for i in range(0,l,1):
        ans=(ans*(count-i))/(i+1)
    elif k==1:	
      count1=0
      count2=0	
      for i in range(0,n,1):
        varlis=mainlis[i]
        if varlis[0]==1:
          count1=count1+1
        if varlis[1]==1:
          count2=count2+1	
      ans1=1
      ans2=1	
      for i in range(0,l,1):
        ans1=(ans1*(count1-i))/(i+1)
        ans2=(ans2*(count2-i))/(i+1)
      ans=ans1%maxv+ans2%maxv
  elif m==3:
    if k==3:
      count=0
      for i in range(0,n,1):
        varlis=mainlis[i]
        if varlis[0]==1 and varlis[1]==1 and varlis[2]==1:
          count=count+1
      ans=1
      for i in range(0,l,1):
        ans=(ans*(count-i))/(i+1)
    elif k==1:
      count1=0
      count2=0
      count3=0	
      for i in range(0,n,1):
        varlis=mainlis[i]
        if varlis[0]==1:
          count1=count1+1
        if varlis[1]==1:
          count2=count2+1
        if varlis[2]==1:
          count3=count3+1
    	
      ans1=1
      ans2=1
      ans3=1
      for i in range(0,l,1):
        ans1=(ans1*(count1-i))/(i+1)
        ans2=(ans2*(count2-i))/(i+1)
        ans3=(ans3*(count3-i))/(i+1)
      ans=ans1%maxv + ans2%maxv +ans3%maxv
    	
    elif k==2:
      count1=0
      count2=0
      count3=0
      for i in range(0,n,1):
        varlis=mainlis[i]	      
        if varlis[0]==1 and varlis[1]==1:
          count1=count1+1
        if varlis[0]==1 and varlis[2]==1:
          count2=count2+1
        if varlis[1]==1 and varlis[2]==1:
          count3=count3+1
      ans1=1
      ans2=1
      ans3=1
# print count1,count2,count3	
      for i in range(0,l,1):
        ans1=(ans1*(count1-i))/(i+1)
        ans2=(ans2*(count2-i))/(i+1)
        ans3=(ans3*(count3-i))/(i+1)
      ans=ans1%maxv + ans2%maxv + ans3%maxv	
    	
	
    	
      	
  print ans%maxv	
  test=test-1