//大连网络赛 1006
// 吐槽:数据比较水。下面代码可以AC
// 但是正解好像是:排序后,前i项的和大于等于i*(i-1) #include <bits/stdc++.h>
using namespace std;
#define LL long long
typedef pair<int,int> pii;
const double inf = 123456789012345.0;
const LL MOD =100000000LL;
const int N =1e4+;
#define clc(a,b) memset(a,b,sizeof(a))
const double eps = 1e-;
void fre() {freopen("in.txt","r",stdin);}
void freout() {freopen("out.txt","w",stdout);}
inline int read() {int x=,f=;char ch=getchar();while(ch>''||ch<'') {if(ch=='-') f=-; ch=getchar();}while(ch>=''&&ch<='') {x=x*+ch-'';ch=getchar();}return x*f;} int main(){
int T;
while(~scanf("%d",&T)){
while(T--){
int n;
scanf("%d",&n);
LL sum=;
int maxx=-;
for(int i=;i<=n;i++){
int x;
scanf("%d",&x);
maxx=max(maxx,x);
sum+=x;
}
if((sum==n*(n-))&&maxx<=(n-)*){
puts("T");
}
else puts("F");
}
}
return ;
}