#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cassert>

using namespace std;

#define pb(x) push_back(x)
#define REP(i,n) for(int i=0; i<int(n); i++)
#define RER(i,s,t) for(int i=(s); i<=int(t); i++)
#define REU(i,s,t) for(int i=(s); i<int(t); i++)

typedef long long LL;

struct VEC
{
    LL x, y;
    VEC(LL x, LL y):x(x), y(y) {}
    VEC(){}
};

VEC operator+(const VEC &a, const VEC &b){
    return VEC(a.x+b.x, a.y+b.y);
}

VEC operator+=(VEC &a, const VEC &b){
    return a=VEC(a+b);
}

VEC operator-(const VEC &a, const VEC &b){
    return VEC(a.x-b.x, a.y-b.y);
}

VEC operator-=(VEC &a, const VEC &b){
    return a=VEC(a-b);
}

VEC operator-(const VEC &x){
    return VEC(-x.x, -x.y);
}

VEC operator*(const VEC &x, const LL &k){
    return VEC(x.x*k, x.y*k);
}

VEC operator*(const LL &k, const VEC &x){
    return x*k;
}

LL operator*(const VEC &a, const VEC& b){
    return a.x*b.x+a.y*b.y;
}

LL operator^(const VEC &a, const VEC &b){
    return a.x*b.y-a.y*b.x;
}

const VEC ZERO(0,0);

bool up(const VEC& x){
    return x.y>0?true:(x.y==0?x.x>0:false);
}

bool PolarCMP(const VEC& a, const VEC& b){
    bool aup=up(a), bup=up(b);
    if(aup!=bup)return aup>bup;
    else return (a^b)>0;
}

void print(const VEC &a){
    printf("(%lld, %lld) ",a.x,a.y);
}

const int MOD=1000003;
//const int MOD=17;

void add(LL &x, LL y){
    x=(x+y%MOD+MOD)%MOD;
}

//#define _debug
//#define _print

void gao(vector<VEC> &v, LL &s, LL &ts)
{
    int n=v.size();
    sort(v.begin(), v.end(), PolarCMP);
    #ifdef _debug
    REP(i,v.size()){
        print(v[i]);
    }
    printf("\n");
    #endif // _debug
    REP(i,n)v.pb(v[i]);
    assert(v.size()==2*n);
    vector<VEC> vsum(v.size()+1);
    vsum[0]=ZERO;
    RER(i,1,v.size())
        vsum[i]=vsum[i-1]+v[i-1];
    VEC LSUM=ZERO, RSUM=ZERO;
    LL LRPROD=0;
    int L=0, R=1;
    while(R<n&&(v[0]^v[R])>=0)R++;
    int opp=R;
    for(L=1; L<R; L++){ //precalculation
        while(opp<L+n&&(v[L]^v[opp])>=0)opp++;
        LSUM+=v[L]*(opp-R);
        RSUM+=vsum[opp]-vsum[R];
        add(LRPROD, v[L]^(vsum[opp]-vsum[R]));
    }
    L=R-1;
    for(int i=0; i<n;){
        #ifdef _print
        printf("i=%d, R=%d, LSUM=",i,R);
        print(LSUM); printf(", RSUM=");
        print(RSUM); printf(", LRPROD=%lld\n",LRPROD);
        printf("pre_s=%lld, ",s);
        #endif // _debug
        
        add(ts, v[i]^(vsum[R]-vsum[i+1]));
        add( s, LRPROD);
        add( s, v[i]^LSUM);
        add( s, RSUM^v[i]);
        
        #ifdef _print
        printf("s=%lld\n",s);
        #endif
        
        if(++i>=n)break;
        
        while(R<i+n&&(v[i]^v[R])>=0)R++;
        if(LSUM.x!=0){
            int k=0;
            k++;
        }
        if((v[i-1]^v[i])>0){
            REU(j, L+1, R){
                //!!remove outdated parts from LSUM, RSUM, LRPROD
                LSUM-=vsum[L+1]-vsum[i];
                RSUM-=v[j]*(L+1-i);
                add(LRPROD,-((vsum[L+1]-vsum[i])^v[j]));
                
                //!!update new LSUM, RSUM, LRPROD
                LSUM+=v[j]*(i+n-R);
                RSUM+=vsum[i+n]-vsum[R];
                add(LRPROD,v[j]^(vsum[i+n]-vsum[R]));
            }
        } else {
            LSUM = RSUM = ZERO;
            LRPROD = 0;
        }
        L=R-1;
    }
}

int modExp(int x, int n){
    int res=1;
    x%=MOD;
    while(n){
        if(n&1)res=(LL)res*x%MOD;
        n>>=1; x=(LL)x*x%MOD;
    }
    return res;
}

main()
{
    //freopen("in","r",stdin);
    //printf("%d %d\n",modExp(3,MOD-2),modExp(2,MOD-2));
    int T;
    scanf("%d",&T);
    REP(tt,T){
        int n;
        scanf("%d",&n);
        vector<VEC> v;
        REP(i,n){
            int x, y;
            scanf("%d%d",&x,&y);
            v.pb(VEC(x,y));
        }
        if(n<=3){
            printf("Case %d: %d\n", tt+1, 0);
            continue;
        }
        //Here area refers to score in the description, e.g. a square of 1*1 has an area of 2
        //ts is the sum of area for all different triangles multiplied by 3
        // s is the sum of area for all concave quadrilaterals multiplied by 3/2
        LL s=0, ts=0;
        REP(i,n){
            VEC bak=v[i];
            swap(v[i],v.back());
            v.erase(v.end()-1);
            assert(v.size()==n-1);
            REP(j,n-1){
                v[j]-=bak;
            }
            vector<VEC> vtmp(v);
            gao(vtmp,s,ts);
            v.pb(VEC(0,0));
            swap(v[i],v.back());
        }
        ts=ts*modExp(3,MOD-2)%MOD;
        ts=ts*(n-3)%MOD;
        #ifdef _debug
        printf("ts=%lld s=%lld\n",ts,s);
        #endif
        s=s*modExp(3,MOD-2)%MOD;
        s=s*2%MOD;
        LL ans=(ts+s)%MOD;
        ans=ans*modExp(2,MOD-2)%MOD;
        printf("Case %d: %lld\n",tt+1, ans);
    }
}
