var n,t,z,ans,x,y,bo,p,q,xp,gcdp,yp,ll:int64; sx:array[0..30]of int64; i:longint; function gcd(a,b:int64;var x,y:int64):int64; var gcdn,xn,yn,num:int64; begin if b=0 then begin x:=1;y:=0; gcd:=a; exit; end; num:=a mod b; gcdn:=gcd(b,num,x,y); xn:=y;yn:=x-(a div b)*y; x:=xn;y:=yn; gcd:=gcdn; exit; end; begin readln(t); while t>0 do begin dec(t); bo:=0;z:=1;ans:=0; for i:=1 to n do sx[i]:=0; readln(n); for i:=0 to n-1 do read(sx[i]); p:=0; for i:=1 to n do begin q:=1 mod (n-i+1); while sx[p]<>i do begin if sx[p]>i then q:=(q+1)mod(n-i+1); p:=(p+1) mod n; end; ll:=n-i+1; gcdp:=gcd(z,ll,xp,yp); if (q-ans)mod gcdp<>0 then begin writeln('Creation August is a SB!'); bo:=1; break; end; ans:=(q-ans) div gcdp*xp*z+ans; ll:=n-i+1; z:=z div gcd(z,ll,xp,yp)*(n-i+1); while ans<0 do inc(ans,z); ans:=ans mod z; end; if ans=0 then inc(ans,z); if bo=0 then writeln(ans); end; end.