#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rel register ll
#define rec register char
#define gc getchar
//#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<23,stdin),p1==p2)?-1:*p1++)
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
char buf[1<<23],*p1=buf,*p2=buf;
inline int read(){
  int x=0,f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
template <typename mitsuha>
inline bool read(mitsuha &x){
  x=0;int f=1;char c=gc();
  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';
  if (!~c) return 0;
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return x=f?x:-x,1;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return 0&pc(48);
  if (x<0) pc('-'),x=-x;
  int bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  return 0;
  }
inline char fuhao(){
  char c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;
const int yuzu=2e5;
typedef int fuko[yuzu|10];
fuko a;
int main() {
  for (int t=read();t--;) {
  	int i,n=read();
  	for (i=1;i<=n;++i) a[i]=read();
  	sort(a+1,a+n+1);
  	if (n&1) puts("Second");
  	else {
	  int lxy=0;
  	  for (i=1;i<=n;i+=2) lxy|=a[i]^a[i+1]?1:0;
  	  puts(lxy?"First":"Second");
	}
  }
}
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

vector<int> in(200005, 0);
vector<int> out(200005, -1);
vector<vector<int>> in_D(200005);
int cnt = 0;

void dfs(int v, int d, vector<vector<int>> &G) {
    in[v] = cnt;
    in_D[d].push_back(in[v]);
    cnt++;

    for (auto &nv : G[v]) {
        dfs(nv, d + 1, G);
    }

    out[v] = cnt;
    cnt++;
}

int main() {
    int n;
    cin >> n;
    vector<int> p(n);  // 0が根
    rep(i, n - 1) {
        cin >> p[i + 1];
        p[i + 1]--;
    }
    int q;
    cin >> q;
    vector<int> u(q), d(q);
    rep(i, q) {
        cin >> u[i] >> d[i];
        u[i]--;
    }

    vector<vector<int>> G(n);
    rep(i, n - 1) { G[p[i + 1]].push_back(i + 1); }
    dfs(0, 0, G);

    rep(i, q) {
        int ans = lower_bound(in_D[d[i]].begin(), in_D[d[i]].end(), out[u[i]]) -
                  lower_bound(in_D[d[i]].begin(), in_D[d[i]].end(), in[u[i]]);
        cout << ans << endl;
    }
}