#include<bits/stdc++.h>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define compress(v) sort(all(v)), v.erase(unique(all(v)), v.end())
usingnamespacestd;constintdi[]={1,-1,0,0};constintdj[]={0,0,1,-1};inlineintid(inti,intj){return(i-1)*8+j;}namespaceBM{vector<int>G[66];intchk[66],par[66],pv;voidClear(){for(inti=0;i<66;i++)G[i].clear();memset(chk,0,sizeofchk);memset(par,-1,sizeofpar);pv=0;}voidAddEdge(ints,inte){G[s].push_back(e);}boolDFS(intv){chk[v]=pv;for(autoi:G[v]){if(chk[i]==pv)continue;chk[i]=pv;if(par[i]==-1||DFS(par[i])){par[i]=v;returntrue;}}returnfalse;}intRun(){intret=0;for(inti=1;i<=8;i++)for(intj=1;j<=8;j++)if(i+j&1)pv++,ret+=DFS(id(i,j));returnret;}}constintN=8;boolBlock[9][9];voidSolve(){BM::Clear();inta,b,c,d;cin>>a>>b>>c>>d;Block[a][b]=Block[c][d]=true;for(inti=1;i<=N;i++)for(intj=1;j<=N;j++){if(Block[i][j])continue;for(intk=0;k<4;k++){intii=i+di[k],jj=j+dj[k];if(ii<1||jj<1||ii>N||jj>N||Block[ii][jj])continue;BM::AddEdge(id(i,j),id(ii,jj));}}intres=BM::Run()==31;cout<<res<<"\n";Block[a][b]=Block[c][d]=false;}intmain(){ios_base::sync_with_stdio(false);cin.tie(nullptr);intT;cin>>T;for(inttc=1;tc<=T;tc++){cout<<"Scenario #"<<tc<<":\n";Solve();cout<<"\n";}}