#include <bits/stdc++.h>
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define rep(i,n) Rep(i,0,n)
#define all(v) v.begin(),v.end()
using namespace std;
using ll=long long;
using vi=vector<int>;
#define _GLIBCXX_DEBUG
const int mod=998244353;
int main(){
    int N;cin>>N;
    vector<int> f(N); rep(i,N) cin >> f[i];
    rep(i,N) f[i]--;
    vi a(N,-1);int count=0;
    rep(i,N){
        if(a[i]>=0) continue;
        a[i]=i;int x=i;
        while(a[f[x]]<0){
            x=f[x];
            a[x]=i;
        }
        if(a[f[x]]<i) continue;
        else count++;
    }
    ll x=2;
    ll ans=1;
    while(count>0){
        if(count&1) {
            ans*=x;
            ans%=mod;
        }
        count>>=1;
        x=x*x;x%=mod;
        
    }
    ans--;ans=(ans+mod)%mod;
    cout << ans << endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define drep(i,n) for (int i = (n)-1; i >= 0; --i)
#define dup(x,y) (((x)+(y)-1)/(y))
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const double EPS = 1e-10;
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 998244353;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
template<typename T> bool chmax(T &a, T b) {if(a<b){a=b; return 1; } return 0; }
template<typename T> bool chmin(T &a, T b) {if(a>b){a=b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
ll mpow(ll x, ll p) {
	if (p==0) return 1;
	ll res=mpow(x,p/2); res=res*res%MOD;
	return p%2?res*x%MOD:res;
}
ll lpow(ll x, ll p) {
	if (p==0) return 1;
	ll res=lpow(x,p/2); res*=res;
	return p%2?res*x:res;
}

int main() {
	int tt;
	cin >> tt;
	while (tt--) {
		int n;
		cin >> n;
		vector<int> a(n);
		rep(i,n) cin >> a[i];
		map<int, int> mp;
		rep(i,n) mp[a[i]]++;
		if (n % 2 == 0) {
			bool b = true;
			for (auto p: mp) {
				if (p.second % 2 == 1) {
					b = false;
				}
			}
			if (b) cout << "Second" << endl;
			else cout << "First" << endl;
		} else {
			cout << "Second" << endl;
		}
	}
}