const modp=99997; var t,l,i,j,n,now,x,r:longint; a,c,hash,tt:array[0..200000] of longint; function gcdd(x,y:longint):longint; var ans:longint; begin if (y=0) then ans:=x else ans:=gcdd(y,x mod y); gcdd:=ans; end; procedure tryit(x:longint); var i,j,t1,t2:longint; r:array[0..200000] of longint; begin for i:=1 to (n div x)-1 do begin t1:=((hash[i*x]-hash[(i-1)*x]+modp) mod modp); t2:=((hash[(i+1)*x]-hash[i*x]+modp) mod modp); if (t1<>t2) then exit; end; if (x<>n) then write(x,' ') else write(x); end; begin readln(t); for l:=1 to t do begin fillchar(a,sizeof(a),0); fillchar(c,sizeof(c),0); readln(n); tt[0]:=1; for i:=1 to n do tt[i]:=int64(tt[i-1]*10001) mod modp; fillchar(hash,sizeof(hash),0); for i:=1 to n do begin read(c[i]); hash[i]:=(hash[i-1]+tt[c[i]]) mod modp; inc(a[c[i]]); end; readln; x:=1; while (x<=n) and (a[x]=0) do inc(x); now:=a[x]; for i:=x+1 to n do if (a[i]>0) then now:=gcdd(now,a[i]); for r:=now downto 1 do if (now mod r=0) then tryit(n div r); writeln; end; end.