ClearAll;
S[{ast_,bst_},{as_,bs_},{at_,bt_},{zs_,zt_}]:=Module[{},
(*Gamma Product terms with only 's' as argument with other paameters*)
Pas=Function[u,Product[Gamma[1-as[[1,n]]+u],{n,1,Length[as[[1]]]}]];
Qas=Function[u,Product[Gamma[as[[2,n]]-u],{n,1,Length[as[[2]]]}]];
Pbs=Function[u,Product[Gamma[bs[[1,n]]-u],{n,1,Length[bs[[1]]]}]];
Qbs=Function[u,Product[Gamma[1-bs[[2,n]]+u],{n,1,Length[bs[[2]]]}]];
Ms=Function[u,Pas[u] Pbs[u]/(Qas[u] Qbs[u])];

(*Gamma Product terms with only 't' as argument with other paameters*)
Pat=Function[u,Product[Gamma[1-at[[1,n]]+u],{n,1,Length[at[[1]]]}]];
Qat=Function[u,Product[Gamma[at[[2,n]]-u],{n,1,Length[at[[2]]]}]];
Pbt=Function[u,Product[Gamma[bt[[1,n]]-u],{n,1,Length[bt[[1]]]}]];
Qbt=Function[u,Product[Gamma[1-bt[[2,n]]+u],{n,1,Length[bt[[2]]]}]];
Mt=Function[u,Pat[u] Pbt[u]/(Qat[u] Qbt[u])];

(*Gamma Product terms with only 's+t' as argument with other paameters*)
Past=Function[{u,v},Product[Gamma[ast[[1,n]]+u+v],{n,1,Length[ast[[1]]]}]];
Qast=Function[{u,v},Product[Gamma[1-ast[[2,n]]-u-v],{n,1,Length[ast[[2]]]}]];
Qbst=Function[{u,v},Product[Gamma[bst[[2,n]]+u+v],{n,1,Length[bst[[2]]]}]];
Mst=Function[{u,v},Past[u,v] /(Qast[u,v] Qbst[u,v])];
Rs=1/4;
Rt=-1/4;
Zs=zs;
Zt=zt;
W=50;
Print["Numerical Integration:"];
value=1/2/2/Pi/Pi/I/I NIntegrate[Ms[s] Mt[t]Mst[s,t] Zs^s Zt^t, {s, Rs-I W, Rs+I W},{t,Rt-I W, Rt+I W}];
Return[value];
];
(*the Rs and Rt should be carefully designed*)
S[{{{1,1.5},{}},{{},{}}},{{{1},{}},{{},{0}}},{{{0.5},{}},{{0},{}}},{26.95,8}]