#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define mod 1000000007

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
void solve() {
    int n;
    cin>>n;
    vector<int> a(n), cn(n, 0);
    int cnt = 0;
    for(int i = 0; i < n; i++){
        cin>>a[i];
        if(a[i] == 1){
            cnt += 1;
            cn[i] = cnt;
        }
    }
    // reverse(a.begin(), a.end());
    int ans = -1, x = a[0];
    for(int i = 0; i < n-1; i++){
        // debug(ans);
        if(a[i] == 1){
            ans *= -1;
        }
        else if(a[i+1] == 1){
            if((cnt - a[i])%2 != 0){
                ans *= -1;
            }
        }
    }
    if(ans == -1){
        cout<<"first\n";
        return;
    }
    cout<<"second\n";

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    cin >> t;
    // pre();
    while (t--)
        solve();

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define mod 1000000007

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
void solve() {
    int n;
    cin>>n;
    vector<int> a(n);
    for(auto& e:a){
        cin>>e;
    }
    // reverse(a.begin(), a.end());
    int ans = -1;
    for(int i = 0; i < n-1; i++){
        if(a[i] == 1){
            ans *= -1;
        }
        else if(a[i+1] == 1 || i == n-1){
            ans *= -1;
        }
    }
    if(ans == -1){
        cout<<"first\n";
        return;
    }
    cout<<"second\n";

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    cin >> t;
    // pre();
    while (t--)
        solve();

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define mod 1000000007

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
void solve() {
    int n;
    cin>>n;
    vector<int> a(n);
    for(auto& e:a){
        cin>>e;
    }
    // reverse(a.begin(), a.end());
    int ans = -1;
    for(int i = 0; i < n-1; i++){
        if(a[i] == 1){
            ans *= -1;
        }
        else if(a[i+1] == 1){
            ans *= -1;
        }
    }
    if(ans == -1){
        cout<<"First\n";
        return;
    }
    cout<<"Second\n";

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    cin >> t;
    // pre();
    while (t--)
        solve();

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define mod 1000000007

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
void solve() {
    int n;
    cin>>n;
    vector<int> a(n);
    for(auto& e:a){
        cin>>e;
    }
    // reverse(a.begin(), a.end());
    int ans = -1;
    for(int i = 0; i < n-1; i++){
        if(a[i] == 1){
            ans *= -1;
        }
        else if(a[i+1] == 1 || i == n-1){
            ans *= -1;
        }
    }
    if(ans == -1){
        cout<<"First\n";
        return;
    }
    cout<<"Second\n";

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    cin >> t;
    // pre();
    while (t--)
        solve();

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define mod 1000000007

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
void solve() {
    int n;
    cin>>n;
    vector<int> a(n);
    for(auto& e:a){
        cin>>e;
    }
    // reverse(a.begin(), a.end());
    int ans = -1;
    for(int i = 0; i < n-1; i++){
        if(a[i] == 1){
            ans *= -1;
        }
        else if(a[i+1] == 1){
            ans *= -1;
        }
    }
    if(ans == -1){
        cout<<"first\n";
        return;
    }
    cout<<"second\n";

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    cin >> t;
    // pre();
    while (t--)
        solve();

    return 0;
}


///Bugichigi vugichigi
///onner code dekhte lojja kore na??? :3
///144
#include <algorithm>
#include <bits/stdc++.h>
#define hagu_shuru int main()
#define hagu_shesh return 0;
#define bug puts("mimimimimimimimimimimimimimimimimimimimimimie");

using namespace std;

hagu_shuru
{
    int t;
    cin >> t;
    while(t--)
    {
        int n,m,i,j,k,l,bugi=1,chigi=0;
        cin >> n ;
        int a[n];

        for(i=0;i<n;i++)
        {
            cin >> a[i];
//            if(i>0){
//            if((a[i]!=1 && a[i-1]==1) || (a[n-1]==1 && a[n-2]==1))
//                bugi=bugi*(-1);}
            if(a[i]==1 && i==0 && n>1)
                bugi*=(-1);
            else if(a[i]==1 && a[i-1]==1 && i<n-1)
                bugi*=(-1);

        }
//        if(a[n-1]==1)
//            bugi*=(-1);
        if(bugi<0)
            puts("Second");
        else if(n==1)
            puts("First");
        else puts("First");
    }

    hagu_shesh
}


///Bugichigi vugichigi
///onner code dekhte lojja kore na??? :3
///144
#include <algorithm>
#include <bits/stdc++.h>
#define hagu_shuru int main()
#define hagu_shesh return 0;
#define bug puts("mimimimimimimimimimimimimimimimimimimimimimie");

using namespace std;

hagu_shuru
{
    int t;
    cin >> t;
    while(t--)
    {
        long int n,m,i,j,k,l,bugi=0,chigi=0;
        cin >> n ;
        long int a[n];

        for(i=0;i<n;i++)
            cin >> a[i];
        for(i=0;i<n;i++){
            if(a[i]==1)
                chigi++;
            if(a[i]>1)
                {bugi++;
                break;}

        }
        if(n==1)
            puts("First");
        else if(chigi==n)
        {
            if(chigi%2)
                puts("First");
            else puts("Second");
        }
        else if(i==0)
            cout << "First\n";
        else if(i%2)
            cout<< "Second\n";
        else cout << "First\n";
    }

    hagu_shesh
}


///Bugichigi vugichigi
///onner code dekhte lojja kore na??? :3
///144
#include <algorithm>
#include <bits/stdc++.h>
#define hagu_shuru int main()
#define hagu_shesh return 0;
#define bug puts("mimimimimimimimimimimimimimimimimimimimimimie");

using namespace std;

hagu_shuru
{
    int t;
    cin >> t;
    while(t--)
    {
        int n,m,i,j,k,l,bugi=0,chigi=0;
        cin >> n ;
        int a[n];

        for(i=0;i<n;i++)
        cin >> a[i];

        for(i=0;i<n-1;i++)
        {
            if(a[i]>1 && a[i+1]>1)
                chigi+=2;
            if(a[i]>1 && a[i+1]==1 && i<n-2)
                chigi++;
            if(a[i]>1 && a[i+1]==1 && i==n-2)
                chigi+=2;
            if(a[i]==1)
                chigi++;
        }
        chigi++;
        if(n==1)
            cout<< "First\n";
        else if(chigi%2==0)
            cout<< "Second\n";
        else cout<< "First\n";

    }
    hagu_shesh
}


///Bugichigi vugichigi
///onner code dekhte lojja kore na??? :3
///144
#include <algorithm>
#include <bits/stdc++.h>
#define hagu_shuru int main()
#define hagu_shesh return 0;
#define bug puts("mimimimimimimimimimimimimimimimimimimimimimie");

using namespace std;

hagu_shuru
{
    int t;
    cin >> t;
    while(t--)
    {
        long int n,m,i,j,k,l,bugi=1,chigi=0;
        cin >> n ;
        long int a[n];

        for(i=0;i<n;i++)
        {
            cin >> a[i];
            if(n==1)
                break;

            if(a[i]==1)
                chigi++;
            if(a[i]==1 && i==0)
                bugi=bugi*(-1);
            else if(a[i]==1 && a[i-1]==1 && i!=n-1)
                bugi=bugi*(-1);

        }
        if(n==1)
            puts("First");
        else if(chigi==n)
        {
            if(chigi%2)
                puts("First");
            else puts("Second");
        }
        else if(bugi<0)
            cout<< "Second\n";
        else if(bugi>0)
            cout << "First\n";

    }

    hagu_shesh
}


///Bugichigi vugichigi
///onner code dekhte lojja kore na??? :3
///144
#include <algorithm>
#include <bits/stdc++.h>
#define hagu_shuru int main()
#define hagu_shesh return 0;
#define bug puts("mimimimimimimimimimimimimimimimimimimimimimie");

using namespace std;

hagu_shuru
{
    int t;
    cin >> t;
    while(t--)
    {
        int n,m,i,j,k,l,bugi=1,chigi=0;
        cin >> n ;
        int a[n];

        for(i=0;i<n;i++)
        {
            cin >> a[i];
//            if(i>0){
//            if((a[i]!=1 && a[i-1]==1) || (a[n-1]==1 && a[n-2]==1))
//                bugi=bugi*(-1);}
            if(a[i]==1 && i==0 && n>1)
                bugi*=(-1);
            else if(a[i]==1 && a[i-1]==1 && i<n-1)
                bugi*=(-1);

        }
//        if(a[n-1]==1)
//            bugi*=(-1);
        if(n==1)
            puts("First");
        else if(bugi<0)
            puts("Second");
        else puts("First");
    }

    hagu_shesh
}


///Bugichigi vugichigi
///onner code dekhte lojja kore na??? :3
///144
#include <algorithm>
#include <bits/stdc++.h>
#define hagu_shuru int main()
#define hagu_shesh return 0;
#define bug puts("mimimimimimimimimimimimimimimimimimimimimimie");

using namespace std;

hagu_shuru
{
    int t;
    cin >> t;
    while(t--)
    {
        long int n,m,i,j,k,l,bugi=1,chigi=0;
        cin >> n ;
        long int a[n];

        for(i=0;i<n;i++)
        {
            cin >> a[i];
            if(n==1)
                break;

            if(a[i]==1)
                chigi++;
            if(a[i]==1 && i==0)
                bugi=++;

        }
        if(n==1)
            puts("First");
        else if(chigi==n)
        {
            if(chigi%2)
                puts("First");
            else puts("Second");
        }
        else if(bugi==0)
            cout << "First\n";
        else if(bugi)
            cout<< "Second\n";
    }

    hagu_shesh
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdio>
#include<vector>
#include<set>
#include<cstring>
#include<cstdlib>
#include<time.h>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll a[maxn];
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		int n;
		scanf("%d",&n);
		int cnt=0,ans=0;
		for(int i=1;i<=n;i++){
			scanf("%lld",&a[i]);
			if(a[i]==1) ans++;
		}
		for(int i=1;i<=n;i++){
			if(a[i]==1){
				cnt++;
			}
			else break;
		}
		if(ans==0){cout<<"First"<<endl;continue;}
		if(cnt==1&&ans==1) {cout<<"Second"<<endl;continue;}
		if(cnt==1&&(ans-cnt)%2==0){cout<<"Second"<<endl;continue;}
		if(cnt==1&&(ans-cnt)%2==1){cout<<"First"<<endl;continue;}
		if(ans-cnt==0&&cnt%2==0){cout<<"Second"<<endl;continue;}
		if(ans-cnt==0&&cnt%2==1){cout<<"First"<<endl;continue;}
		if(cnt>1&&cnt%2==0&&(ans-cnt)%2==1) {cout<<"First"<<endl;continue;}
		if(cnt>1&&cnt%2==0&&(ans-cnt)%2==0) {cout<<"Second"<<endl;continue;}
		if(cnt>1&&cnt%2==1&&(ans-cnt)%2==0) {cout<<"Second"<<endl;continue;}
		if(cnt>1&&cnt%2==1&&(ans-cnt)%2==1) {cout<<"Second"<<endl;continue;}
	}
  return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdio>
#include<vector>
#include<set>
#include<cstring>
#include<cstdlib>
#include<time.h>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll a[maxn];
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		int n;
		scanf("%d",&n);
		int cnt=0;
		int flag=1;
		for(int i=1;i<=n;i++){
			scanf("%lld",&a[i]);
			if(a[i]==1)
				cnt++;
		}
		for(int i=1;i<n;i++){
			if(a[i]==1&&a[i+1]==1){
				cnt--;
			}
		}
		if(cnt==0) {cout<<"First"<<endl;continue;}
		if((n+cnt)%2==0) {cout<<"First"<<endl;continue;}
		if((n+cnt)%2==1) {cout<<"Second"<<endl;continue;}
	}
  return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdio>
#include<vector>
#include<set>
#include<cstring>
#include<cstdlib>
#include<time.h>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll a[maxn];
int main(){
	int t;
	cin>>t;
	while( t-- )
	{
		int n;
		cin >> n;
		int xian=1,hou=0;
		for(int i=1;i<=n;i++)
			cin >> a[i];
		for(int i=1;i<=n;i++)
		{
			if( a[i]==1 )
			{
				if(xian)	hou=1,xian=0;
				else if(hou)	xian=1,hou=0;
			}
			else
			{
				if( xian )	xian=hou=1;
				else	xian=hou=0;
				break;
			}
		}
		if( hou )	cout<<"First"<<endl;
		else cout<<"Second"<<endl;
		return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdio>
#include<vector>
#include<set>
#include<cstring>
#include<cstdlib>
#include<time.h>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll a[maxn];
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		int n;
		scanf("%d",&n);
		int cnt=0;
		for(int i=1;i<=n;i++)
			scanf("%lld",&a[i]);
		for(int i=1;i<=n;i++){
			if(a[i]==1){
				cnt++;
			}
			else break;
		}
		if(cnt==0){cout<<"First"<<endl;continue;}
		if(cnt==1) {cout<<"Second"<<endl;continue;}
		if(cnt==2) {cout<<"First"<<endl;continue;}
		if(cnt>2&&cnt%2==0) {cout<<"Second"<<endl;continue;}
		if(cnt>2&&cnt%2==1) {cout<<"First"<<endl;continue;}
	}
  return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdio>
#include<vector>
#include<set>
#include<cstring>
#include<cstdlib>
#include<time.h>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll a[maxn];
int main(){
	int t;
	cin>>t;
	while( t-- )
	{
		int n;
		cin >> n;
		int xian=1,hou=0;//代表目前可以是先手
		for(int i=1;i<=n;i++)
			cin >> a[i];
		for(int i=1;i<=n;i++)
		{
			if( a[i]==1 )
			{
				if(xian)	hou=1,xian=0;
				else if(hou)	xian=1,hou=0;
			}
			else
			{
				if( xian )	xian=hou=1;
				else	xian=hou=0;
				break;
			}
		}
		if( hou )	cout<<"First"<<endl;
		else cout<<"Second"<<endl;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdio>
#include<vector>
#include<set>
#include<cstring>
#include<cstdlib>
#include<time.h>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll a[maxn];
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		int n;
		scanf("%d",&n);
		int cnt=1;
		for(int i=1;i<=n;i++){
			scanf("%lld",&a[i]);
			if(a[i]==1)
				cnt++;
		}
		if(cnt==1) {cout<<"First"<<endl;continue;}
		for(int i=1;i<n;i++){
			if(a[i]==1&&a[i+1]==1){
				cnt--;
			}
		}
		if((n+cnt)%2==0) {cout<<"Second"<<endl;continue;}
		if((n+cnt)%2==1) {cout<<"First"<<endl;continue;}
	}
  return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdio>
#include<vector>
#include<set>
#include<cstring>
#include<cstdlib>
#include<time.h>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll a[maxn];
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		int n;
		scanf("%d",&n);
		int cnt=0;
		for(int i=1;i<=n;i++){
			scanf("%lld",&a[i]);
			if(a[i]==1)
				cnt++;
		}
		if(cnt==0) {cout<<"First"<<endl;continue;}
		for(int i=1;i<n;i++){
			if(a[i]==1&&a[i+1]==1){
				cnt--;
			}
		}
		if((n+cnt)%2==0) {cout<<"First"<<endl;continue;}
		if((n+cnt)%2==1) {cout<<"Second"<<endl;continue;}
	}
  return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
#include<cstdio>
#include<vector>
#include<set>
#include<cstring>
#include<cstdlib>
#include<time.h>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
const int maxn=1e5+5;
typedef long long ll;
ll a[maxn];
int main(){
	int t;
	cin>>t;
	while( t-- )
	{
		int n;
		cin >> n;
		int xian=1,hou=0;//代表目前可以是先手
		for(int i=1;i<=n;i++)
			cin >> a[i];
		for(int i=1;i<=n;i++)
		{
			if( a[i]==1 )
			{
				if(xian)	hou=1,xian=0;
				else if(hou)	xian=1,hou=0;
			}
			else
			{
				if( xian )	xian=hou=1;//那我赢了呀!!先后后手任我选
				else	xian=hou=0;//那我输了呀,因为对手是先手,可以左右游戏了
				break;
			}
		}
		if( hou )	cout<<"First"<<endl;
		else cout<<"Second"<<endl;
	}
		return 0;
}


//allah is greatest,muhammad is our prophet
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,i,j=0;
        bool meow=true;

        cin>>n;long long a[n];
        for(i=0;i<n;i++){cin>>a[i];
        if(i==0 & a[0]==1){meow=false;}
        else if(a[i]==1 && a[i-1]==1 && meow==true && i<n-1){meow=false;}
        else if(a[i]==1 && a[i-1]==1 && meow==false && i<n-1){meow=true;}

        }
        if(meow==true)cout<<"First"<<endl;
        else cout<<"Second"<<endl;

    }
    return 0;
}


//allah is greatest,muhammad is our prophet
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,i,j=0;
        bool meow=true;

        cin>>n;long long a[n];
        for(i=0;i<n;i++){cin>>a[i];
        if(a[i]>1)meow=false;
         if(meow==true && a[i]==1 && i<n-1)j+=1;

        }
        if(j%2==0)cout<<"First"<<endl;
        else cout<<"Second"<<endl;

    }
    return 0;
}


//allah is greatest,muhammad is our prophet
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,i,j;
        bool meow=false;
        cin>>n;long long a[n];
        for(i=0;i<n;i++){cin>>a[i];if(a[i]!=1)meow=true;}
        if(meow==true){
        if(a[0]>1)cout<<"First"<<endl;
        else cout<<"Second"<<endl;}
        else
        {
            if(n%2==0)cout<<"Second"<<endl;
            else cout<<"First"<<endl;
        }

    }
    return 0;
}


//allah is greatest,muhammad is our prophet
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,i,j=0;
        bool meow=true;

        cin>>n;long long a[n];
        for(i=0;i<n;i++){cin>>a[i];
        if(i==0 & a[0]==1){meow=false;cout<<"hi"<<endl;}
        else if(a[i]==1 && a[i-1]==1 && meow==true && i<n-1){meow=false;}
        else if(a[i]==1 && a[i-1]==1 && meow==false && i<n-1){meow=true;}

        }
        if(meow==true)cout<<"First"<<endl;
        else cout<<"Second"<<endl;

    }
    return 0;
}


//allah is greatest,muhammad is our prophet
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,i,j=0;
        bool meow=false;
        cin>>n;long long a[n];
        for(i=0;i<n;i++){cin>>a[i];if(a[i]==1 && i<n-1)j++;}
        if(j%2==0)cout<<"First"<<endl;
        else cout<<"Second"<<endl;

    }
    return 0;
}


//allah is greatest,muhammad is our prophet
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        long long n,i,j=0;
        bool meow=true;

        cin>>n;long long a[n];
        for(i=0;i<n;i++){cin>>a[i];
        if(i==0 & a[0]==1)meow=false; else if(a[i]==1 && a[i-1]!=1 && meow==true && i<n-1)meow=false;
        else if(a[i]==1 && a[i-1]!=1 && meow==false && i<n-1)meow=true; else continue;
        }
        if(meow==true)cout<<"First"<<endl;
        else cout<<"Second"<<endl;

     j=0;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	int x,y,z,a,b,c,m,k;
	int t;
	cin >> t;
	for(int i=1;i<=t;i++){
		int none = 0;
		int ntwo = 0;
		cin >> x;
		for(int j=1;j<=x;j++){
			cin >> y;
			if(y==1) none++;
			else none+=2;
			if(!ntwo && y>1) ntwo=j;
		}
		//cout << ntwo << " " << none << endl;
		if(!ntwo) none&1 ? puts("First"):puts("Second");
		else ntwo&1? puts("First"): puts("Second");
	}
}


#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	int x,y,z,a,b,c,m,k;
	int t;
	cin >> t;
	for(int i=1;i<=t;i++){
		int none = 0;
		int ntwo = 0;
		cin >> x;
		for(int j=1;j<=x;j++){
			cin >> y;
			if(y==1) none++;
			else none+=2;
			if(!ntwo && y>1) ntwo=j;
		}
		//cout << ntwo << " " << none << endl;
		if(!ntwo) none & 1 ? puts("First"):puts("Second");
		else if(ntwo&1) puts("First");
		else puts("Second");
	}
}


#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	int x,y,z,a,b,c,m,k;
	int t;
	    ios_base::sync_with_stdio(0);

	    cin.tie(0);cout.tie(0);

	cin >> t;
	for(int i=1;i<=t;i++){
		int none = 0;
		int ntwo = 0;
		cin >> x;
		for(int j=1;j<=x;j++){
			cin >> y;
			if(y==1) none++;
			else none+=2;
			if(!ntwo && y>1) ntwo=j;
		}
		//cout << ntwo << " " << none << endl;
		if(!ntwo) none&1 ? puts("First"):puts("Second");
		else ntwo&1? puts("First"): puts("Second");
	}
}


#include <iostream>
#include <algorithm>
using namespace std;

int main(){
	int x,y,z,a,b,c,m,k;
	int t;
	    cin.tie(0);cout.tie(0);

	cin >> t;
	for(int i=1;i<=t;i++){
		int none = 0;
		int ntwo = 0;
		cin >> x;
		for(int j=1;j<=x;j++){
			cin >> y;
			if(y==1) none++;
			else none+=2;
			if(!ntwo && y>1) ntwo=j;
		}
		//cout << ntwo << " " << none << endl;
		if(!ntwo) none&1 ? puts("First"):puts("Second");
		else ntwo&1? puts("First"): puts("Second");
	}
}


#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a,x) for (auto& a : x)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001; //check the limits, dummy

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);

    int T; cin >> T;
    while(T--) {
        int N; cin >> N;
        int A[N]; F0R(i, N) cin >> A[i];
        int cnt = 0;
        F0R(i, N) {
            if (A[i] == 1) {
                cnt++;
            } else break;
        }
        if (cnt == N) cnt++;
 //       cnt %= 2;
        cout << (cnt%2?"Second":"First") << nl;
    }

	return 0;
}

// read the question correctly (ll vs int)
// template by bqi343


#include<bits/stdc++.h>
#define ll long long int
#define st string
#define con continue
#define rt return 0
#define br break
using namespace std;
int main()
{
 ll tc; cin>>tc;while(tc--){
 ll a,b,m,c,n,x=1,cnt=1,i,j,k=1;
 st s,str;
 cin>>n;
 ll ara[n+1];
    map<ll,ll>mp;
 for(i=1;i<=n;i++)
   {
        cin>>ara[i];
    }
// sort(ara,ara+n);
// cnt=ara[0];
 for(i=1;i<n;i++)
  {
      //if(ara[i]!=ara[i+1]) x++;
     if(ara[i]==1)
        {
           if(ara[i+1]!=1)
            {
             if((i+1)%2)
          cout<<"First"<<endl;
               else cout<<"Second"<<endl;
            goto ab;
            }
         }
      else cnt++;

  }
   //if(ara[n-1]!=ara[n-2]) x++;
// cout<<cnt<<endl;
        if(n%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;

        ab: con;
}
 rt;
}


#include<bits/stdc++.h>
#define ll long long int
#define st string
#define con continue
#define rt return 0
#define br break
using namespace std;
int main()
{
 ll tc; cin>>tc;while(tc--){
 ll a,b,m,c,n,x=1,cnt=1,i,j,k=1;
 st s,str;
 cin>>n;
 ll ara[n+1];
    map<ll,ll>mp;
 for(i=0;i<n;i++)
   {
        cin>>ara[i];
    }
 //sort(ara,ara+n);
 cnt=ara[0]+1;
 for(i=1;i<n-1;i++)
  {
      if(ara[i]!=ara[i+1]) x++;
     if(ara[i]!=ara[i+1]) {cnt+=2;}
      else cnt++;

  }
   if(ara[n-1]!=ara[n-2]) x++;
// cout<<cnt<<endl;
  if(x==n) {
        if(x%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;
    }
else if(cnt%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;
}
 rt;
}


#include<bits/stdc++.h>
#define ll long long int
#define st string
#define con continue
#define rt return 0
#define br break
using namespace std;
int main()
{
 ll tc; cin>>tc;while(tc--){
 ll a,b,m,c,n,x=1,cnt=1,i,j,k=1;
 st s,str;
 cin>>n;
 ll ara[n+1];
    map<ll,ll>mp;
 for(i=0;i<n;i++)
   {
        cin>>ara[i];
    }
 sort(ara,ara+n);
 for(i=1;i<n;i++)
  {

     if(ara[i]!=ara[i-1]) {cnt+=2;x++;}
      else cnt++;

  }
// cout<<cnt<<endl;
  if(x==n) {
        if(x%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;
    }
else if(cnt%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;
}
 rt;
}


#include<bits/stdc++.h>
#define ll long long int
#define st string
#define con continue
#define rt return 0
#define br break
using namespace std;
int main()
{
 ll tc; cin>>tc;while(tc--){
 ll a,b,m,c,n,x=1,cnt=1,i,j,k=1;
 st s,str;
 cin>>n;
 ll ara[n+1];
    map<ll,ll>mp;
 for(i=0;i<n;i++)
   {
        cin>>ara[i];
    }
 //sort(ara,ara+n);
 cnt=ara[0];
 for(i=1;i<n;i++)
  {

     if(ara[i]!=ara[i-1]) {cnt+=2;x++;}
      else cnt++;

  }
// cout<<cnt<<endl;
  if(x==n) {
        if(x%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;
    }
else if(cnt%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;
}
 rt;
}


#include<bits/stdc++.h>
#define ll long long int
#define st string
#define con continue
#define rt return 0
#define br break
#define g goto
using namespace std;
int main()
{
 ll tc; cin>>tc;while(tc--){
 ll a,b,m,c,n,cnt=0,i,j,k=1;
 st s,str;
 cin>>n;ll x=n;
 ll ara[n+1];
    map<ll,ll>mp;
 for(i=1;i<=n;i++)
   {
        cin>>ara[i];
           if(ara[i]>1 &&! cnt)
            {
             x=i;
              cnt++;
            }
   }
        if(x%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;

        ab: con;
}
 rt;
}


#include<bits/stdc++.h>
#define ll long long int
#define st string
#define con continue
#define rt return 0
#define br break
using namespace std;
int main()
{
 ll tc; cin>>tc;while(tc--){
 ll a,b,m,c,n,x=1,cnt=1,i,j,k=1;
 st s,str;
 cin>>n;
 ll ara[n+1];
    map<ll,ll>mp;
 for(i=0;i<n;i++)
   {
        cin>>ara[i];
    }
 sort(ara,ara+n);
 cnt=ara[0];
 for(i=1;i<n;i++)
  {
      //if(ara[i]!=ara[i+1]) x++;
     if(ara[i]!=ara[i-1]) {cnt+=2;x++;}
      else cnt++;

  }
   //if(ara[n-1]!=ara[n-2]) x++;
// cout<<cnt<<endl;
  if(x==n) {
        if(x%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;
    }
else if(cnt%2)
 cout<<"First"<<endl;
    else cout<<"Second"<<endl;
}
 rt;
}


#include <bits/stdc++.h>

#define f(a,b,i) for(int i=a;i<b;i++)
#define g(a,b,i) for(int i=b-1;i>=a;i--)
//#define int long long
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mp make_pair
#define float double
#define M 1000000007
#define MAX INT_MAX
#define MIN INT_MIN
#define N 200000
#define mp make_pair
using namespace std;

signed main(){
    int t;
    cin>>t;
    while(t){
        int m;
        cin>>m;
        int d[m]; int count=0;
        f(0,m,i){ cin>>d[i]; }
        f(0,m,i){
            if(d[i]>1){ if(i%2==0) cout<<"First"<<"\n";
            else cout<<"Second"<<"\n";
            count=1; break;}
        }
        if(count==0){
            if(m%2==0) cout<<"Second"<<"\n";
            else cout<<"First"<<"\n";
        }
        t--;
    }
}


#include <bits/stdc++.h>

#define f(a,b,i) for(int i=a;i<b;i++)
#define g(a,b,i) for(int i=b-1;i>=a;i--)
//#define int long long
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mp make_pair
#define float double
#define M 1000000007
#define MAX INT_MAX
#define MIN INT_MIN
#define N 200000
#define mp make_pair
using namespace std;

signed main(){
    int t; cin>>t;
    while(t--){
        int m;
        cin>>m;
        int d[m]; int count=0;
        f(0,n,i){ cin>>d[i]; }
        f(0,n,i){
            if(d[i]>1){ if(i%2==0) cout<<"First"<<"\n";
            else cout<<"Second"<<"\n";
            count=1; break;}
        }
        if(count==0){
            if(n%2==0) cout<<"Second"<<"\n";
            else cout<<"First"<<"\n";
        }
    }
}


#include <bits/stdc++.h>

#define f(a,b,i) for(int i=a;i<b;i++)
#define g(a,b,i) for(int i=b-1;i>=a;i--)
//#define int long long
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mp make_pair
#define float double
#define M 1000000007
#define MAX INT_MAX
#define MIN INT_MIN
#define N 200000
#define mp make_pair
using namespace std;

signed main(){
    int t; cin>>t;
    while(t--){
        int n;
        cin>>n;
        int a[n];
        f(0,n,i) cin>>a[i];
        cout<<"First"<<endl;
    }
}


#include <bits/stdc++.h>

#define f(a,b,i) for(int i=a;i<b;i++)
#define g(a,b,i) for(int i=b-1;i>=a;i--)
//#define int long long
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mp make_pair
#define float double
#define M 1000000007
#define MAX INT_MAX
#define MIN INT_MIN
#define N 200000
#define mp make_pair
using namespace std;

signed main(){
    int t;
    cin>>t;
    while(t){
        int m;
        cin>>m;
        int d[m]; int count=0;
        f(0,m,i){ cin>>d[i]; }
        f(0,m,i){
            if(d[i]>1){ if(i%2==0) cout<<"First"<<"\n";
            else cout<<"Second"<<"\n";
            count=1; break;}
        }
        if(count==0){
            if(n%2==0) cout<<"Second"<<"\n";
            else cout<<"First"<<"\n";
        }
        t--;
    }
}


#include <bits/stdc++.h>

#define f(a,b,i) for(int i=a;i<b;i++)
#define g(a,b,i) for(int i=b-1;i>=a;i--)
//#define int long long
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mp make_pair
#define float double
#define M 1000000007
#define MAX INT_MAX
#define MIN INT_MIN
#define N 200000
#define mp make_pair
using namespace std;

signed main(){
    int t; cin>>t;
    while(t--){
        int n;
        cin>>n;
        int a[n]; int count=0;
        f(0,n,i){ cin>>a[i]; if(a[i]==1) count++;}
        if(n%2==0 ) cout<<"Second";
        else cout<<"First"<<endl;
    }
}


#include <bits/stdc++.h>

#define f(a,b,i) for(int i=a;i<b;i++)
#define g(a,b,i) for(int i=b-1;i>=a;i--)
//#define int long long
#define pb push_back
#define FAST_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mp make_pair
#define float double
#define M 1000000007
#define MAX INT_MAX
#define MIN INT_MIN
#define N 200000
#define mp make_pair
using namespace std;

signed main(){
    int t; cin>>t;
    while(t--){
        int n;
        cin>>n;
        int a[n]; int count=0;
        f(0,n,i){ cin>>a[i]; if(a[i]==1) count++;}
        if(n%2==0 ) cout<<"Second"<<endl;
        else cout<<"First"<<endl;
    }
}


#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define in(n1) cin>>n1
#define lp(i,j,n) for(int i=j;i<=n;i++)
#define out1(n1) cout<<n1<<endl
#define out2(n2) cout<<n2<<" "
#define ll long long
#define ld long double
#define f first
#define s second
using namespace std;

void solve()
{
	ll n;
	in(n);

	ll arr[n];
	lp(i, 0, n - 1)
	in(arr[i]);

	ll count = 0, i = 0;
	while (i < n && arr[i] == 1)
		count++;

	if (count % 2 == 0)
		out1("First");
	else
		out1("Second");

}

int main()
{

#ifndef ONLINE_JUDGE

	freopen("inputs.txt", "r", stdin);

	freopen("outputs.txt", "w", stdout);
#endif
	fast;
	ll t, n, a, b, c, e, f, g, temp, m;
	in(t);

	lp(i, 1, t)
	solve();

	return 0;
}


#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define in(n1) cin>>n1
#define lp(i,j,n) for(int i=j;i<=n;i++)
#define out1(n1) cout<<n1<<endl
#define out2(n2) cout<<n2<<" "
#define ll long long
#define ld long double
#define f first
#define s second
using namespace std;

void solve()
{
	ll n;
	in(n);

	ll arr[n];
	lp(i, 0, n)
	in(arr[i]);

	ll count = 0, i = 0;
	while (i < n && arr[i] == 1)
		count++;

	if (count % 2 == 0)
		out1("First");
	else
		out1("Second");

}

int main()
{

#ifndef ONLINE_JUDGE

	freopen("inputs.txt", "r", stdin);

	freopen("outputs.txt", "w", stdout);
#endif
	fast;
	ll t, n, a, b, c, e, f, g, temp, m;
	in(t);

	lp(i, 1, t)
	solve();

	return 0;
}


#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define in(n1) cin>>n1
#define lp(i,j,n) for(int i=j;i<=n;i++)
#define out1(n1) cout<<n1<<endl
#define out2(n2) cout<<n2<<" "
#define ll long long
#define ld long double
#define f first
#define s second
using namespace std;

void solve()
{
	ll n;
	in(n);

	ll arr[n];
	lp(i, 0, n - 1)
	in(arr[i]);

	ll count = 0, i = 0;
	while (i < n - 1 && arr[i++] == 1)
		count++;

	if (count % 2 == 0)
		out1("First");
	else
		out1("Second");

}

int main()
{

#ifndef ONLINE_JUDGE

	freopen("inputs.txt", "r", stdin);

	freopen("outputs.txt", "w", stdout);
#endif
	fast;
	ll t, n, a, b, c, e, f, g, temp, m;
	in(t);

	lp(i, 1, t)
	solve();

	return 0;
}


#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define in(n1) cin>>n1
#define lp(i,j,n) for(int i=j;i<=n;i++)
#define out1(n1) cout<<n1<<endl
#define out2(n2) cout<<n2<<" "
#define ll long long
#define ld long double
#define f first
#define s second
using namespace std;

// int binarysearch(int arr[], int key, int n)
// {
// 	int l = 0, h = n - 1;
// 	while (l <= h) {
// 		int mid = l + (r - l) / 2;
// 		if (arr[mid] == key)
// 			return mid;
// 		else if (arr[mid] < key)
// 			l = mid + 1;
// 		else
// 			h = mid - 1;
// 	}
// 	return -1;
// }S7

ll min(ll x, ll y)
{
	return y ^ ((x ^ y) & -(x < y));
}
ll max(ll x, ll y)
{
	return x ^ ((x ^ y) & -(x < y));
}

void solve()
{
	ll n;
	in(n);

	ll arr[n];
	lp(i, 0, n)
	in(arr[i]);

	ll count = 0, i = 0;
	while (i < n && arr[i] == 1)
		count++;

	if (count % 2 == 0)
		out1("First");
	else
		out1("Second");

}

int main()
{

#ifndef ONLINE_JUDGE

	freopen("inputs.txt", "r", stdin);

	freopen("outputs.txt", "w", stdout);
#endif
	fast;
	ll t, n, a, b, c, e, f, g, temp, m;
	in(t);

	lp(i, 0, t)
	solve();

	return 0;
}


#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define in(n1) cin>>n1
#define lp(i,j,n) for(int i=j;i<=n;i++)
#define out1(n1) cout<<n1<<endl
#define out2(n2) cout<<n2<<" "
#define ll long long
#define ld long double
#define f first
#define s second
using namespace std;

void solve()
{
	ll n;
	in(n);

	ll arr[n];
	lp(i, 0, n - 1)
	in(arr[i]);

	ll count = 0, i = 0;
	while (i < n && arr[i++] == 1)
		count++;

	if (count % 2 == 0)
		out1("First");
	else
		out1("Second");

}

int main()
{

#ifndef ONLINE_JUDGE

	freopen("inputs.txt", "r", stdin);

	freopen("outputs.txt", "w", stdout);
#endif
	fast;
	ll t, n, a, b, c, e, f, g, temp, m;
	in(t);

	lp(i, 1, t)
	solve();

	return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    long long int x[1000],y[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       r=0;
       s=0;
       l=0;
       t=0;
       int b=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];

       }
        for(i=0;i<n1-1;i++)
        {
            if(x[i]==1)
            {
                l++;
            }
            else
            {
                break;
            }
        }
       if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    long long int x[100000],y[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       r=0;
       s=0;
       l=0;
       t=0;
       int b=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];
           if(x[i]>1)
           {
                r++;
           }
           else
           {
                s++;
           }
            if(i>0 && x[0]==1 && t==0)
            {
                if(x[i-1]==1 && x[i]==1)
                {
                    l++;
                }
                else
                {
                    t++;
                }
            }

       }
       if(x[0]==1)
       {
           l++;
       }
       if(s==0)
       {
           cout<<"First"<<endl;
       }
       else if(r==0)
       {
           if(s%2==0)
           {
               cout<<"Second"<<endl;
           }
           else
           {
               cout<<"First"<<endl;
           }
       }
       else
       {
          if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
       }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    long long int x[1000],y[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       r=0;
       s=0;
       l=0;
       t=0;
       int b=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];
           if(x[i]>1)
           {
                r++;
           }
           else
           {
                s++;
           }

       }

       if(s==0)
       {
           cout<<"First"<<endl;
       }
       else if(r==0)
       {
           if(s%2==0)
           {
               cout<<"Second"<<endl;
           }
           else
           {
               cout<<"First"<<endl;
           }
       }
       else
       {
           for(i=0;;i++)
           {
               if(x[i]==1)
               {
                   l++;
               }
               else
               {
                   break;
               }
           }
          if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
       }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    long long int x[1000],y[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       r=0;
       s=0;
       l=0;
       t=0;
       int b=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];
           if(x[i]>1)
           {
                r++;
           }
           else
           {
                s++;
           }

       }
        for(i=0;i<n1-1;i++)
        {
            if(x[i]==1)
            {
                l++;
            }
            else
            {
                break;
            }
        }
       if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    long long int x[1000],y[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       r=0;
       s=0;
       l=0;
       t=0;
       int b=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];
           if(x[i]>1)
           {
                r++;
           }
           else
           {
                s++;
           }

       }
        for(i=0;i<n1-1;i++)
        {
            if(x[i]==1)
            {
                l++;
            }
            else
            {
                break;
            }
        }
       if(s==0)
       {
           cout<<"First"<<endl;
       }
       else
       {
          if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
       }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int x[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       l=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];

       }
        for(i=0;i<n1-1;i++)
        {
            if(x[i]==1)
            {
                l++;
            }
            else
            {
                break;
            }
        }
       if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    long long int x[1000],y[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       r=0;
       s=0;
       l=0;
       t=0;
       int b=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];
           if(x[i]>1)
           {
                r++;
           }
           else
           {
                s++;
           }
            if(i>0 && x[0]==1 && t==0)
            {
                if(x[i-1]==1 && x[i]==1)
                {
                    l++;
                }
                else
                {
                    t++;
                }
            }

       }
       if(x[0]==1)
       {
           l++;
       }
       if(s==0)
       {
           cout<<"First"<<endl;
       }
       else if(r==0)
       {
           if(s%2==0)
           {
               cout<<"Second"<<endl;
           }
           else
           {
               cout<<"First"<<endl;
           }
       }
       else
       {
          if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
       }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    long long int x[1000],y[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       r=0;
       s=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];
           if(x[i]>1)
           {
                r++;
           }
           if(x[i]==1)
           {
                s++;
           }
       }
       l=0;
       if(s==0)
       {
           cout<<"First"<<endl;
       }
       else if(r==0)
       {
           if(s%2==0)
           {
               cout<<"Second"<<endl;
           }
           else
           {
               cout<<"First"<<endl;
           }
       }
       else
       {
            for(i=0;i<n1;i++)
        {
            if(x[i]==1)
            {
                l++;
            }
            else
            {
                break;
            }
        }
          if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
       }
    }
    return 0;
}


#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
    long long int x[1000],y[1000],i,j,k,q,r,s,n1,n2,z,l,p,t;
    cin>>q;
    while(q--)
    {
       cin>>n1;
       r=0;
       s=0;
       for(i=0;i<n1;i++)
       {
           cin>>x[i];
           if(x[i]>1)
           {
                r++;
           }
           if(x[i]==1)
           {
                s++;
           }
       }
       l=0;
        for(i=0;i<n1;i++)
        {
            if(x[i]==1)
            {
                l++;
            }
            else
            {
                break;
            }
        }
       if(s==0)
       {
           cout<<"First"<<endl;
       }
       else if(r==0)
       {
           if(s%2==0)
           {
               cout<<"Second"<<endl;
           }
           else
           {
               cout<<"First"<<endl;
           }
       }
       else
       {
          if(l%2==0)
          {
              cout<<"First"<<endl;
          }
          else
          {
              cout<<"Second"<<endl;
          }
       }
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

// main function -
// where the execution of program begins
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        long long arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        bool ans=true;
        for(int i=0;i<n-1;i++){
            if((arr[i]>1 && arr[i+1]==1)||(arr[i]==1)){
                ans=!(ans);
            }
        }
        if(ans){
            cout<<"First"<<endl;
        }
        else{
            cout<<"Second"<<endl;
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;
int t, n, a[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> t;
    while(t--) {
        cin >> n;
        for(int i = 0; i < n; i++) {
            cin >> a[i];
        }
        bool win=true;
        for(int i=0;i<n;i++){
            if(a[i]==1)win=!win;
            else{win!=win;break;}
        }
        if(win)cout<<"Second"<<endl;
        else cout<<"First"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        int arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        bool ans=true;
        for(int i=0;i<n;i++){
            if(arr[i]==1)ans=!ans;
            else break;
        }
        if(ans)cout<<"First"<<endl;
        else cout<<"Second"<<endl;
    }
}


#include<bits/stdc++.h>

using namespace std;

// main function -
// where the execution of program begins
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        int arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        bool ans=true;
        for(int i=0;i<n-1;i++){
            if((arr[i]>1 && arr[i+1]==1)||(arr[i]==1)){
                ans=!(ans);
            }
        }
        if(ans){
            cout<<"First"<<endl;
        }
        else{
            cout<<"Second"<<endl;
        }
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

// main function -
// where the execution of program begins
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        long long arr[n];
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        bool ans=true;
        for(int i=0;i<n-1;i++){
            if((arr[i]>1 && arr[i+1]==1 && i!=n-2)||(arr[i]==1)){
                ans=!(ans);
            }
        }
        if(ans){
            cout<<"First"<<endl;
        }
        else{
            cout<<"Second"<<endl;
        }
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;
int t, n, a[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> t;
    while(t--) {
        cin >> n;
        for(int i = 0; i < n; i++) {
            cin >> a[i];
        }
        bool win=true;
        for(int i=0;i<n;i++){
            if(a[i]==1)win=!win;
            else{win=!win;break;}
        }

        cout << (win ? "Second" : "First") << '\n';
    }
}


#include<bits/stdc++.h>
using namespace std;
int main() {
	long long int t;
	cin>>t;
	while(t--)
	{
	    long long int n=6;
	    cin>>n;
	    vector<long long int>v;
	    for(int i=0;i<n;i++)
	    {
	        long long int a;
	        cin>>a;
	        v.push_back(a);
	    }
	    if(n==1)
	    {
	        cout<<"First"<<endl;
	    }
	    else if(n>1)
	    {   long long int c=0;
	        for(int i=n-1;i>=0;i--)
	        {
	            if(v[i]!=1)
	            {
	                break;
	            }
	            else if(v[i]==1)
	            {
	                c=c+1;
	            }
	        }
	        if(c==n)
	        {
	            if(c%2!=0)
	            {
	                cout<<"First"<<endl;
	            }
	            else if(c%2==0)
	            {
	                cout<<"Second"<<endl;
	            }
	        }
	        else if(c<n)
	        {
	            int turn=1;
	            int in=0;
	            while(in<n)
	            {
                    if(v[in]==1)
                    {
                        v[in]=0;
                        in=in+1;
                    }
                    else if(v[in]!=1)
                    {
                        if(in==((n-1)-c))
                        {
                            if(c%2==0)
                            {
                                v[in]=0;
                                in=in+1;
                            }
                            else if(c%2!=0)
                            {
                                v[in]=1;
                                in=in;
                            }
                        }
                        else if(in!=((n-1)-c))
                        {
                            if(v[in+1]==1)
                            {
                                v[in]=0;
                                in=in+1;
                            }
                            else
                            {
                                v[in]=1;
                                in=in;
                            }
                        }
                    }
                    turn=turn+1;
	            }
	            if(turn%2==0)
	            {
	                cout<<"First"<<endl;
	            }
	            else if(turn%2!=0)
	            {
	                cout<<"Second"<<endl;
	            }
	        }
	    }
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define re register
#define cs const

using std::cerr;
using std::cout;

cs int N=2e3+7;

int n,m,k,Ans;

int g[N][N],f[N][N];
int u[N][N],d[N][N];
int x[N],y[N];
int gu[N],gd[N];

int ans[N];

signed main(){
#ifdef zxyoi
	freopen("parking.in","r",stdin);
#endif
	scanf("%d%d%d",&n,&m,&k);
	for(int re i=1;i<=n;++i){
		getchar();
		for(int re j=1;j<=m;++j)
		g[i][j]=(getchar()=='X');
	}
	for(int re i=1;i<=k;++i){
		scanf("%d%d",x+i,y+i);
		g[x[i]][y[i]]=1;
	}
	for(int re i=0;i<=n+1;++i)
	for(int re j=0;j<=m+1;++j)
	u[i][j]=d[i][j]=i;
	for(int re i=1;i<=n;++i)
	for(int re j=1;j<=m;++j)
	if(!g[i][j])u[i][j]=u[i-1][j];
	for(int re i=n;i;--i)
	for(int re j=1;j<=m;++j)
	if(!g[i][j])d[i][j]=d[i+1][j];
	for(int re i=1;i<=n;++i)
	for(int re j=1;j<=m;++j)
	if(!g[i][j]){
		f[i][j]=std::min(f[i-1][j-1],std::min(f[i-1][j],f[i][j-1]))+1;
		Ans=std::max(Ans,f[i][j]);
	}
	for(int re t=k;t;--t){
		int x0=x[t],y0=y[t];
		g[x0][y0]=0,ans[t]=Ans;
		for(int re i=x0;i<=n;++i)
		if(!g[i][y0])u[i][y0]=u[i-1][y0];
		else break;
		for(int re i=x0;i;--i)
		if(!g[i][y0])d[i][y0]=d[i+1][y0];
		else break;
		gu[y0]=u[x0][y0];gd[y0]=d[x0][y0];
		for(int re i=y0-1;i;--i){
			gu[i]=std::max(gu[i+1],u[x0][i]);
			gd[i]=std::min(gd[i+1],d[x0][i]);
		}
		for(int re i=y0+1;i<=m;++i){
			gu[i]=std::max(gu[i-1],u[x0][i]);
			gd[i]=std::min(gd[i-1],d[x0][i]);
		}
		for(int re i=y0;i<=m;++i)
		while(i-Ans>0&&std::min(gd[i],gd[i-Ans])-std::max(gu[i],gu[i-Ans])-1>Ans)++Ans;
	}
	for(int re i=1;i<=k;++i)cout<<ans[i]<<"\n";
	return 0;
}


#include <bits/stdc++.h> // sherlock_holmes
using namespace std;

#define LL long long int
#define updateL unsigned long long int

#define imax INT_MAX
#define imin INT_MIN
#define LLmax LLONG_MAX
#define LLmin LLONG_MIN

#define FOR(i,a,b) for(int i= (int)a; i<= (int)b; i++)
#define rep(i,n) for(int i= int(1); i<= (int)n; i++)
#define FORd(i,a,b,d) for(int i=(int)a; i<= (int)b; i+=(int)d)

#define track1() printf("track 1\n");
#define track2() printf("track 2\n");
#define track3() printf("track 3\n");
#define track4() printf("track 4\n");

#define CLR(a) memset(a,0,sizeof(a));
#define SET(a) memset(a,-1,sizeof(a));

#define sz size()
#define pb(x) push_back(x)
#define mp make_pair
#define ii pair<int,int>

#define i4 pair<ii,ii>

#define ll pair<LL,LL>

#define bi pair<bool,int>

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)

#define mod int(1e9 + 7)
#define N int(2000 + 50)

#define si(a) scanf("%d",&a);

#define VI vector<int>
#define VL vector<LL>
#define VS vector<string>
#define VC vector<char>

LL powm(LL a,int b,int n){LL rm=1;while (b){if (b % 2) { rm = (rm * a) % n; }a = (a * a) % n;b /= 2;}return rm;}

char s[N][N];
int x[N], y[N];
vector<i4> squares[N];
int tree[N][N]={0}, max_x, max_y, n, m, k;
bool cd = false;

int p_r[N * N], p_l[N * N];

int merge_r(int node)
{
	if(p_r[node] == node)
		return node;
	p_r[node] = merge_r(p_r[node]);
	return p_r[node];
}

int merge_l(int node)
{
	if(p_l[node] == node)
		return node;
	p_l[node] = merge_l(p_l[node]);
	return p_l[node];
}

int f1(int r1,int c1,int r2,int c2)
{
	return tree[r2][c2] - tree[r1-1][c2] - tree[r2][c1-1] + tree[r1-1][c1-1];
}

int A[N]={0};

int ff(int node)
{
	if(node%m == 0)
		return m;
	return node%m;
}

bool check(int l,int rr,int cc)
{
	int r1 = rr, r2 = rr, col, leftBar, rightBar, row, del;

	while(r1>1){
		if(s[r1 - 1][cc - 1] == '.')
			r1--;
		else
			break;
	}
	while(r2 < n)
		if(s[r2+1][cc - 1] == '.')
			r2++;
		else
			break;

	if(r2 - r1 + 1 < l)
		return false;
	multiset<int> myset_l, myset_r;

	for(int i = r1; i <= r2; ++i){
		merge_l(i*m-m+cc); // get-max
		merge_r(i*m-m+cc); // get-min
		col = ff(p_l[i*m-m + cc]);

		if(s[i][col-1] == 'X')
			col++;

		myset_l.insert(-col);

		col = ff(p_r[i*m-m + cc]);
		if(s[i][col-1] == 'X')
			col--;

		myset_r.insert(col);

		if(i >= r1 + l -1){
			leftBar = -(*myset_l.begin());
			rightBar = *myset_r.begin();

			if(rightBar - leftBar + 1 >= l)
				return true;
		}

		if(i >= r1 + l -1){

			row = i - l + 1;
			del = ff(p_l[(row-1)*m + cc]);
			if(s[row][del-1] == 'X')
			    del++;

			myset_l.erase(myset_l.find(-del));

			del = ff(p_r[(row-1)*m + cc]);
			if(s[row][del-1] == 'X')
			    del--;

			myset_r.erase(myset_r.find(del));

		}

	}
	return false;
}

int main()
{

	si(n); si(m); si(k);
	max_x = n, max_y = m;
	rep(i,n)
		scanf("%s",s[i]);
	rep(i,k)
	{
		si(x[i]); si(y[i]);
		s[x[i]][y[i]-1] = 'X';
	}

	rep(i,n){
		int col = 0;
		rep(j,m){
			if(s[i][j-1] == 'X')
				col ++;
			tree[i][j] = tree[i-1][j] + col;
		}
	}

	int mx, ans = 0;
	for(int i = 1; i <=n ; ++i){
		for(int j = 1; j <= m; ++j){
			mx = min(n-i+1,m-j+1);
			for(int l = ans+1; l <= mx; ++l){
				if(f1(i,j,i+l-1,j+l-1) == 0){
					ans = l;
				}
				else
					break;
			}
		}
	}

	rep(i,n){
		int bfr = 1;
		for(int j =1 ; j <=m ; ++j){
			if(s[i][j-1] == 'X')
				bfr = j;
			p_l[i*m-m+j] = (i-1)*m + bfr;
		}
	}

	rep(i,n){
		int last = m;
		for(int j = m; j >=1; j--){
			if(s[i][j-1] == 'X')
				last = j;
			p_r[i*m-m+j] = (i-1)* m + last;
		}
	}
	A[k] = ans;

	int MaxAns = min(n,m), node;

	for(int i = k; i >=1 ; i--){
		A[i] = ans;
	//	cout << i << " -->>  " << A[i] << endl;

		s[x[i]][y[i] - 1] = '.';
		node = x[i]*m-m+y[i];
		if(y[i] == m)
			p_r[node] = x[i]*m;
		else
		{
			merge_r(node+1);
			p_r[node] = p_r[node+1];
		}
		if(y[i] == 1)
			p_l[node] = x[i]*m-m+1;
		else
		{
			merge_l(node-1);
			p_l[node] = p_l[node-1];
		}

		for(int start = ans + 1; start <= MaxAns; ++start){
			if(check(start, x[i], y[i]) == false)
				break;
			ans = start;

		}

	}

	rep(i,k)
		printf("%d\n",A[i]);

	return 0;
}


#include <bits/stdc++.h> // sherlock_holmes
using namespace std;

#define LL long long int
#define updateL unsigned long long int

#define imax INT_MAX
#define imin INT_MIN
#define LLmax LLONG_MAX
#define LLmin LLONG_MIN

#define FOR(i,a,b) for(int i= (int)a; i<= (int)b; i++)
#define rep(i,n) for(int i= int(1); i<= (int)n; i++)
#define FORd(i,a,b,d) for(int i=(int)a; i<= (int)b; i+=(int)d)

#define track1() printf("track 1\n");
#define track2() printf("track 2\n");
#define track3() printf("track 3\n");
#define track4() printf("track 4\n");

#define CLR(a) memset(a,0,sizeof(a));
#define SET(a) memset(a,-1,sizeof(a));

#define sz size()
#define pb(x) push_back(x)
#define mp make_pair
#define ii pair<int,int>

#define i4 pair<ii,ii>

#define ll pair<LL,LL>

#define bi pair<bool,int>

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)

#define mod int(1e9 + 7)
#define N int(2000 + 50)

#define si(a) scanf("%d",&a);

#define VI vector<int>
#define VL vector<LL>
#define VS vector<string>
#define VC vector<char>

LL powm(LL a,int b,int n){LL rm=1;while (b){if (b % 2) { rm = (rm * a) % n; }a = (a * a) % n;b /= 2;}return rm;}

char s[N][N];
int x[N], y[N];
vector<i4> squares[N];
int tree[N][N]={0}, max_x, max_y;

void update(int x , int y , int val){
    int y1;
    while (x <= max_x){
        y1 = y;
        while (y1 <= max_y){
            tree[x][y1] += val;
            y1 += (y1 & (-y1));
        }
        x += (x & (-x));
    }
}

int read(int x,int y){ // return sum from 1,1 to x,y.
           int sum= 0;
             while( x){
                  int y1 = y;
                 while(y1){
                     sum += tree[x][y1];
                       y1 -= y1 & (-y1);
                }
                x -= x & (-x);
            }
          return sum;
}

int f1(int r1,int c1,int r2,int c2)
{
	return tree[r2][c2] - tree[r1-1][c2] - tree[r2][c1-1] + tree[r1-1][c1-1];
}

int f2(i4 box)
{
	int r1 = box.F.F, c1 = box.F.S, r2 = box.S.F, c2 = box.S.S;
	return read(r2,c2) - read(r2,c1-1) - read(r1-1,c2) + read(r1-1,c1-1);
}

int main()
{
	int n,m,k;
	si(n); si(m); si(k);
	max_x = n, max_y = m;
	rep(i,n)
		scanf("%s",s[i]);
	rep(i,k)
	{
		si(x[i]); si(y[i]);
	}

	rep(i,n){
		int col = 0;
		rep(j,m){
			if(s[i][j-1] == 'X')
				col ++;
			tree[i][j] = tree[i-1][j] + col;
		}
	}

	int mx;
	for(int i = 1; i <=n ; ++i){
		for(int j = 1; j <= m; ++j){
			mx = min(n-i+1,m-j+1);
			for(int l = 1; l <= mx; ++l){
				if(f1(i,j,i+l-1,j+l-1) == 0){
					squares[l].pb( mp( mp(i,j), mp(i+l-1, j+l-1) ));
				}
			}
		}
	}

	CLR(tree);

	rep(i,n)
		rep(j,m)
			if(s[i][j-1] == 'X')
				update(i, j, +1);

	int pL = min(n, m), pL_k = 0;

	rep(i,k){
		update(x[i], y[i], +1);

		while(true){
			if(pL_k == squares[pL].sz){
				pL--;
				pL_k = 0;
			}
			else if(f2(squares[pL][pL_k]) == 0){
				break;
			}
			else{
				pL_k++;
			}
		}

		printf("%d\n",pL);
		if(pL == 0)
			continue;
	}

	return 0;
}


#include <bits/stdc++.h> // sherlock_holmes
using namespace std;

#define LL long long int
#define updateL unsigned long long int

#define imax INT_MAX
#define imin INT_MIN
#define LLmax LLONG_MAX
#define LLmin LLONG_MIN

#define FOR(i,a,b) for(int i= (int)a; i<= (int)b; i++)
#define rep(i,n) for(int i= int(1); i<= (int)n; i++)
#define FORd(i,a,b,d) for(int i=(int)a; i<= (int)b; i+=(int)d)

#define track1() printf("track 1\n");
#define track2() printf("track 2\n");
#define track3() printf("track 3\n");
#define track4() printf("track 4\n");

#define CLR(a) memset(a,0,sizeof(a));
#define SET(a) memset(a,-1,sizeof(a));

#define sz size()
#define pb(x) push_back(x)
#define mp make_pair
#define ii pair<int,int>

#define i4 pair<ii,ii>

#define ll pair<LL,LL>

#define bi pair<bool,int>

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)

#define mod int(1e9 + 7)
#define N int(2000 + 50)

#define si(a) scanf("%d",&a);

#define VI vector<int>
#define VL vector<LL>
#define VS vector<string>
#define VC vector<char>

LL powm(LL a,int b,int n){LL rm=1;while (b){if (b % 2) { rm = (rm * a) % n; }a = (a * a) % n;b /= 2;}return rm;}

char s[N][N];
int x[N], y[N];
vector<i4> squares[N];
int tree[N][N]={0}, max_x, max_y, n, m, k;
bool cd = false;

int p_r[N * N], p_l[N * N];

int merge_r(int node)
{
	if(p_r[node] == node)
		return node;
	p_r[node] = merge_r(p_r[node]);
	return p_r[node];
}

int merge_l(int node)
{
	if(p_l[node] == node)
		return node;
	p_l[node] = merge_l(p_l[node]);
	return p_l[node];
}

int f1(int r1,int c1,int r2,int c2)
{
	return tree[r2][c2] - tree[r1-1][c2] - tree[r2][c1-1] + tree[r1-1][c1-1];
}

int A[N]={0};

int ff(int node)
{
	if(node%m == 0)
		return m;
	return node%m;
}

bool check(int l,int rr,int cc)
{
	int r1 = rr, r2 = rr, col, leftBar, rightBar, row, del;

	while(r1>1){
		if(s[r1 - 1][cc - 1] == '.')
			r1--;
		else
			break;
	}
	while(r2 < n)
		if(s[r2+1][cc - 1] == '.')
			r2++;
		else
			break;

	if(r2 - r1 + 1 < l)
		return false;

	deque<ii> myset_l, myset_r;

	for(int i = r1; i <= r2; ++i){
		merge_l(i*m-m+cc); // get-max
		merge_r(i*m-m+cc); // get-min
		col = ff(p_l[i*m-m + cc]);

		if(s[i][col-1] == 'X')
			col++;
		while(!myset_l.empty()){
			if(myset_l.back().S <= col)
				myset_l.pop_back();
			else
				break;
		}
		myset_l.push_back(mp(i, col));

		col = ff(p_r[i*m-m + cc]);
		if(s[i][col-1] == 'X')
			col--;

		while(!myset_r.empty()){
			if(myset_r.back().S >= col)
				myset_r.pop_back();
			else
				break;
		}
		myset_r.push_back(mp(i, col));

		if(i >= r1 + l - 1){
			if( myset_r.front().S - myset_l.front().S  + 1 >= l)
				return true;
			row = i - l + 1;

			while(!myset_l.empty()){
				if(myset_l.front().F <= row){
					myset_l.pop_front();
				}
				else
					break;
			}

			while(!myset_r.empty()){
				if(myset_r.front().F <= row){
					myset_r.pop_front();
				}
				else
					break;
			}
		}

	}
	return false;
}

int main()
{

	si(n); si(m); si(k);
	max_x = n, max_y = m;
	rep(i,n)
		scanf("%s",s[i]);
	rep(i,k)
	{
		si(x[i]); si(y[i]);
		s[x[i]][y[i]-1] = 'X';
	}

	rep(i,n){
		int col = 0;
		rep(j,m){
			if(s[i][j-1] == 'X')
				col ++;
			tree[i][j] = tree[i-1][j] + col;
		}
	}

	int mx, ans = 0;
	for(int i = 1; i <=n ; ++i){
		for(int j = 1; j <= m; ++j){
			mx = min(n-i+1,m-j+1);
			for(int l = mx; l >= 1; --l){
				if(f1(i,j,i+l-1,j+l-1) == 0){
					ans = max(ans,l);
					break;
				}
			}
		}
	}

	rep(i,n){
		int bfr = 1;
		for(int j =1 ; j <=m ; ++j){
			if(s[i][j-1] == 'X')
				bfr = j;
			p_l[i*m-m+j] = (i-1)*m + bfr;
		}
	}

	rep(i,n){
		int last = m;
		for(int j = m; j >=1; j--){
			if(s[i][j-1] == 'X')
				last = j;
			p_r[i*m-m+j] = (i-1)* m + last;
		}
	}
	A[k] = ans;

	int MaxAns = min(n,m), node;

	for(int i = k; i >=1 ; i--){
		A[i] = ans;
	//	cout << i << " -->>  " << A[i] << endl;

		s[x[i]][y[i] - 1] = '.';
		node = x[i]*m-m+y[i];
		if(y[i] == m)
			p_r[node] = x[i]*m;
		else
		{
			merge_r(node+1);
			p_r[node] = p_r[node+1];
		}
		if(y[i] == 1)
			p_l[node] = x[i]*m-m+1;
		else
		{
			merge_l(node-1);
			p_l[node] = p_l[node-1];
		}

		for(int start = ans + 1; start <= MaxAns; ++start){
			if(check(start, x[i], y[i]) == false)
				break;
			ans = start;

		}

	}

	rep(i,k)
		printf("%d\n",A[i]);

	return 0;
}


#include <bits/stdc++.h> // sherlock_holmes
using namespace std;

#define LL long long int
#define updateL unsigned long long int

#define imax INT_MAX
#define imin INT_MIN
#define LLmax LLONG_MAX
#define LLmin LLONG_MIN

#define FOR(i,a,b) for(int i= (int)a; i<= (int)b; i++)
#define rep(i,n) for(int i= int(1); i<= (int)n; i++)
#define FORd(i,a,b,d) for(int i=(int)a; i<= (int)b; i+=(int)d)

#define track1() printf("track 1\n");
#define track2() printf("track 2\n");
#define track3() printf("track 3\n");
#define track4() printf("track 4\n");

#define CLR(a) memset(a,0,sizeof(a));
#define SET(a) memset(a,-1,sizeof(a));

#define sz size()
#define pb(x) push_back(x)
#define mp make_pair
#define ii pair<int,int>

#define i4 pair<ii,ii>

#define ll pair<LL,LL>

#define bi pair<bool,int>

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)

#define mod int(1e9 + 7)
#define N int(2000 + 50)

#define si(a) scanf("%d",&a);

#define VI vector<int>
#define VL vector<LL>
#define VS vector<string>
#define VC vector<char>

LL powm(LL a,int b,int n){LL rm=1;while (b){if (b % 2) { rm = (rm * a) % n; }a = (a * a) % n;b /= 2;}return rm;}

char s[N][N];
int x[N], y[N];
vector<i4> squares[N];
int tree[N][N]={0}, max_x, max_y, n, m, k;
bool cd = false;

int p_r[N * N], p_l[N * N];

int merge_r(int node)
{
	if(p_r[node] == node)
		return node;
	p_r[node] = merge_r(p_r[node]);
	return p_r[node];
}

int merge_l(int node)
{
	if(p_l[node] == node)
		return node;
	p_l[node] = merge_l(p_l[node]);
	return p_l[node];
}

int f1(int r1,int c1,int r2,int c2)
{
	return tree[r2][c2] - tree[r1-1][c2] - tree[r2][c1-1] + tree[r1-1][c1-1];
}

int A[N]={0};

int ff(int node)
{
	if(node%m == 0)
		return m;
	return node%m;
}

bool check(int l,int rr,int cc)
{
	int r1 = rr, r2 = rr, col, leftBar, rightBar, row, del;

	while(r1>1){
		if(s[r1 - 1][cc - 1] == '.')
			r1--;
		else
			break;
	}
	while(r2 < n)
		if(s[r2+1][cc - 1] == '.')
			r2++;
		else
			break;

	if(r2 - r1 + 1 < l)
		return false;
	multiset<int> myset_l, myset_r;

	for(int i = r1; i <= r2; ++i){
		merge_l(i*m-m+cc); // get-max
		merge_r(i*m-m+cc); // get-min
		col = ff(p_l[i*m-m + cc]);

		if(s[i][col-1] == 'X')
			col++;

		myset_l.insert(-col);

		col = ff(p_r[i*m-m + cc]);
		if(s[i][col-1] == 'X')
			col--;

		myset_r.insert(col);

		if(i >= r1 + l -1){
			leftBar = -(*myset_l.begin());
			rightBar = *myset_r.begin();

			if(rightBar - leftBar + 1 >= l)
				return true;
		}

		if(i >= r1 + l -1){

			row = i - l + 1;
			del = ff(p_l[(row-1)*m + cc]);
			if(s[row][del-1] == 'X')
			    del++;

			myset_l.erase(myset_l.find(-del));

			del = ff(p_r[(row-1)*m + cc]);
			if(s[row][del-1] == 'X')
			    del--;

			myset_r.erase(myset_r.find(del));

		}

	}
	return false;
}

int main()
{

	si(n); si(m); si(k);
	max_x = n, max_y = m;
	rep(i,n)
		scanf("%s",s[i]);
	rep(i,k)
	{
		si(x[i]); si(y[i]);
		s[x[i]][y[i]-1] = 'X';
	}

	rep(i,n){
		int col = 0;
		rep(j,m){
			if(s[i][j-1] == 'X')
				col ++;
			tree[i][j] = tree[i-1][j] + col;
		}
	}

	int mx, ans = 0;
	for(int i = 1; i <=n ; ++i){
		for(int j = 1; j <= m; ++j){
			mx = min(n-i+1,m-j+1);
			for(int l = mx; l >= 1; --l){
				if(f1(i,j,i+l-1,j+l-1) == 0){
					ans = max(ans,l);
					break;
				}
			}
		}
	}

	rep(i,n){
		int bfr = 1;
		for(int j =1 ; j <=m ; ++j){
			if(s[i][j-1] == 'X')
				bfr = j;
			p_l[i*m-m+j] = (i-1)*m + bfr;
		}
	}

	rep(i,n){
		int last = m;
		for(int j = m; j >=1; j--){
			if(s[i][j-1] == 'X')
				last = j;
			p_r[i*m-m+j] = (i-1)* m + last;
		}
	}
	A[k] = ans;

	int MaxAns = min(n,m), node;

	for(int i = k; i >=1 ; i--){
		A[i] = ans;
	//	cout << i << " -->>  " << A[i] << endl;

		s[x[i]][y[i] - 1] = '.';
		node = x[i]*m-m+y[i];
		if(y[i] == m)
			p_r[node] = x[i]*m;
		else
		{
			merge_r(node+1);
			p_r[node] = p_r[node+1];
		}
		if(y[i] == 1)
			p_l[node] = x[i]*m-m+1;
		else
		{
			merge_l(node-1);
			p_l[node] = p_l[node-1];
		}

		for(int start = ans + 1; start <= MaxAns; ++start){
			if(check(start, x[i], y[i]) == false)
				break;
			ans = start;

		}

	}

	rep(i,k)
		printf("%d\n",A[i]);

	return 0;
}


#include <bits/stdc++.h> // sherlock_holmes
using namespace std;

#define LL long long int
#define updateL unsigned long long int

#define imax INT_MAX
#define imin INT_MIN
#define LLmax LLONG_MAX
#define LLmin LLONG_MIN

#define FOR(i,a,b) for(int i= (int)a; i<= (int)b; i++)
#define rep(i,n) for(int i= int(1); i<= (int)n; i++)
#define FORd(i,a,b,d) for(int i=(int)a; i<= (int)b; i+=(int)d)

#define track1() printf("track 1\n");
#define track2() printf("track 2\n");
#define track3() printf("track 3\n");
#define track4() printf("track 4\n");

#define CLR(a) memset(a,0,sizeof(a));
#define SET(a) memset(a,-1,sizeof(a));

#define sz size()
#define pb(x) push_back(x)
#define mp make_pair
#define ii pair<int,int>

#define i4 pair<ii,ii>

#define ll pair<LL,LL>

#define bi pair<bool,int>

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)

#define mod int(1e9 + 7)
#define N int(2000 + 50)

#define si(a) scanf("%d",&a);

#define VI vector<int>
#define VL vector<LL>
#define VS vector<string>
#define VC vector<char>

LL powm(LL a,int b,int n){LL rm=1;while (b){if (b % 2) { rm = (rm * a) % n; }a = (a * a) % n;b /= 2;}return rm;}

char s[N][N];
int x[N], y[N];
vector<i4> squares[N];
int tree[N][N]={0}, max_x, max_y, n, m, k;
bool cd = false;

int p_r[N * N], p_l[N * N];

int merge_r(int node)
{
	if(p_r[node] == node)
		return node;
	p_r[node] = merge_r(p_r[node]);
	return p_r[node];
}

int merge_l(int node)
{
	if(p_l[node] == node)
		return node;
	p_l[node] = merge_l(p_l[node]);
	return p_l[node];
}

int f1(int r1,int c1,int r2,int c2)
{
	return tree[r2][c2] - tree[r1-1][c2] - tree[r2][c1-1] + tree[r1-1][c1-1];
}

int A[N]={0};

int ff(int node)
{
	if(node%m == 0)
		return m;
	return node%m;
}

bool check(int l,int rr,int cc)
{
	int r1 = rr, r2 = rr, col, leftBar, rightBar, row, del;

	while(r1>1){
		if(s[r1 - 1][cc - 1] == '.')
			r1--;
		else
			break;
	}
	while(r2 < n)
		if(s[r2+1][cc - 1] == '.')
			r2++;
		else
			break;

	if(r2 - r1 + 1 < l)
		return false;

	deque<ii> myset_l, myset_r;

	for(int i = r1; i <= r2; ++i){
		merge_l(i*m-m+cc); // get-max
		merge_r(i*m-m+cc); // get-min
		col = ff(p_l[i*m-m + cc]);

		if(s[i][col-1] == 'X')
			col++;
		while(!myset_l.empty()){
			if(myset_l.back().S <= col)
				myset_l.pop_back();
			else
				break;
		}
		myset_l.push_back(mp(i, col));

		col = ff(p_r[i*m-m + cc]);
		if(s[i][col-1] == 'X')
			col--;

		while(!myset_r.empty()){
			if(myset_r.back().S >= col)
				myset_r.pop_back();
			else
				break;
		}
		myset_r.push_back(mp(i, col));

		if(i >= r1 + l - 1){
			if( myset_r.front().S - myset_l.front().S  + 1 >= l)
				return true;
			row = i - l + 1;

			while(!myset_l.empty()){
				if(myset_l.front().F <= row){
					myset_l.pop_front();
				}
				else
					break;
			}

			while(!myset_r.empty()){
				if(myset_r.front().F <= row){
					myset_r.pop_front();
				}
				else
					break;
			}
		}

	}
	return false;
}

int main()
{

	si(n); si(m); si(k);
	max_x = n, max_y = m;
	rep(i,n)
		scanf("%s",s[i]);
	rep(i,k)
	{
		si(x[i]); si(y[i]);
		s[x[i]][y[i]-1] = 'X';
	}

	rep(i,n){
		int col = 0;
		rep(j,m){
			if(s[i][j-1] == 'X')
				col ++;
			tree[i][j] = tree[i-1][j] + col;
		}
	}

	int mx, ans = 0;
	for(int i = 1; i <=n ; ++i){
		for(int j = 1; j <= m; ++j){
			mx = min(n-i+1,m-j+1);
			for(int l = ans+1; l <= mx; ++l){
				if(f1(i,j,i+l-1,j+l-1) == 0){
					ans = l;
					break;
				}
			}
		}
	}

	rep(i,n){
		int bfr = 1;
		for(int j =1 ; j <=m ; ++j){
			if(s[i][j-1] == 'X')
				bfr = j;
			p_l[i*m-m+j] = (i-1)*m + bfr;
		}
	}

	rep(i,n){
		int last = m;
		for(int j = m; j >=1; j--){
			if(s[i][j-1] == 'X')
				last = j;
			p_r[i*m-m+j] = (i-1)* m + last;
		}
	}
	A[k] = ans;

	int MaxAns = min(n,m), node;

	for(int i = k; i >=1 ; i--){
		A[i] = ans;
	//	cout << i << " -->>  " << A[i] << endl;

		s[x[i]][y[i] - 1] = '.';
		node = x[i]*m-m+y[i];
		if(y[i] == m)
			p_r[node] = x[i]*m;
		else
		{
			merge_r(node+1);
			p_r[node] = p_r[node+1];
		}
		if(y[i] == 1)
			p_l[node] = x[i]*m-m+1;
		else
		{
			merge_l(node-1);
			p_l[node] = p_l[node-1];
		}

		for(int start = ans + 1; start <= MaxAns; ++start){
			if(check(start, x[i], y[i]) == false)
				break;
			ans = start;

		}

	}

	rep(i,k)
		printf("%d\n",A[i]);

	return 0;
}


#include <bits/stdc++.h> // sherlock_holmes
using namespace std;

#define LL long long int
#define updateL unsigned long long int

#define imax INT_MAX
#define imin INT_MIN
#define LLmax LLONG_MAX
#define LLmin LLONG_MIN

#define FOR(i,a,b) for(int i= (int)a; i<= (int)b; i++)
#define rep(i,n) for(int i= int(1); i<= (int)n; i++)
#define FORd(i,a,b,d) for(int i=(int)a; i<= (int)b; i+=(int)d)

#define track1() printf("track 1\n");
#define track2() printf("track 2\n");
#define track3() printf("track 3\n");
#define track4() printf("track 4\n");

#define CLR(a) memset(a,0,sizeof(a));
#define SET(a) memset(a,-1,sizeof(a));

#define sz size()
#define pb(x) push_back(x)
#define mp make_pair
#define ii pair<int,int>

#define i4 pair<ii,ii>

#define ll pair<LL,LL>

#define bi pair<bool,int>

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)

#define mod int(1e9 + 7)
#define N int(2000 + 50)

#define si(a) scanf("%d",&a);

#define VI vector<int>
#define VL vector<LL>
#define VS vector<string>
#define VC vector<char>

LL powm(LL a,int b,int n){LL rm=1;while (b){if (b % 2) { rm = (rm * a) % n; }a = (a * a) % n;b /= 2;}return rm;}

char s[N][N];
int x[N], y[N];
vector<i4> squares[N];
int tree[N][N]={0}, max_x, max_y, n, m, k;
bool cd = false;

int p_r[N * N], p_l[N * N];

int merge_r(int node)
{
	if(p_r[node] == node)
		return node;
	p_r[node] = merge_r(p_r[node]);
}

int merge_l(int node)
{
	if(p_l[node] == node)
		return node;
	p_l[node] = merge_l(p_l[node]);
}

int f1(int r1,int c1,int r2,int c2)
{
	return tree[r2][c2] - tree[r1-1][c2] - tree[r2][c1-1] + tree[r1-1][c1-1];
}

int A[N]={0};

int ff(int node)
{
	if(node%m == 0)
		return m;
	return node%m;
}

bool check(int l,int rr,int cc)
{
	int r1 = rr, r2 = rr, col, leftBar, rightBar, row, del;

	while(r1>1){
		if(s[r1 - 1][cc - 1] == '.')
			r1--;
		else
			break;
	}
	while(r2 < n)
		if(s[r2+1][cc - 1] == '.')
			r2++;
		else
			break;

	if(r2 - r1 + 1 < l)
		return false;
	multiset<int> myset_l, myset_r;

	for(int i = r1; i <= r2; ++i){
		merge_l(i*m-m+cc); // get-max
		merge_r(i*m-m+cc); // get-min
		col = ff(p_l[i*m-m + cc]);

		if(s[i][col-1] == 'X')
			col++;

		myset_l.insert(-col);

		col = ff(p_r[i*m-m + cc]);
		if(s[i][col-1] == 'X')
			col--;

		myset_r.insert(col);

		if(i >= r1 + l -1){
			leftBar = -(*myset_l.begin());
			rightBar = *myset_r.begin();

			if(rightBar - leftBar + 1 >= l)
				return true;
		}

		if(i >= r1 + l -1){

			row = i - l + 1;
			del = ff(p_l[(row-1)*m + cc]);
			if(s[row][del-1] == 'X')
			    del++;

			myset_l.erase(myset_l.find(-del));

			del = ff(p_r[(row-1)*m + cc]);
			if(s[row][del-1] == 'X')
			    del--;

			myset_r.erase(myset_r.find(del));

		}

	}
	return false;
}

int main()
{

	si(n); si(m); si(k);
	max_x = n, max_y = m;
	rep(i,n)
		scanf("%s",s[i]);
	rep(i,k)
	{
		si(x[i]); si(y[i]);
		s[x[i]][y[i]-1] = 'X';
	}

	rep(i,n){
		int col = 0;
		rep(j,m){
			if(s[i][j-1] == 'X')
				col ++;
			tree[i][j] = tree[i-1][j] + col;
		}
	}

	int mx, ans = 0;
	for(int i = 1; i <=n ; ++i){
		for(int j = 1; j <= m; ++j){
			mx = min(n-i+1,m-j+1);
			for(int l = mx; l >= 1; --l){
				if(f1(i,j,i+l-1,j+l-1) == 0){
					ans = max(ans,l);
					break;
				}
			}
		}
	}

	rep(i,n){
		int bfr = 1;
		for(int j =1 ; j <=m ; ++j){
			if(s[i][j-1] == 'X')
				bfr = j;
			p_l[i*m-m+j] = (i-1)*m + bfr;
		}
	}

	rep(i,n){
		int last = m;
		for(int j = m; j >=1; j--){
			if(s[i][j-1] == 'X')
				last = j;
			p_r[i*m-m+j] = (i-1)* m + last;
		}
	}
	A[k] = ans;

	int MaxAns = min(n,m), node;

	for(int i = k; i >=1 ; i--){
		A[i] = ans;
	//	cout << i << " -->>  " << A[i] << endl;

		s[x[i]][y[i] - 1] = '.';
		node = x[i]*m-m+y[i];
		if(y[i] == m)
			p_r[node] = x[i]*m;
		else
		{
			merge_r(node+1);
			p_r[node] = p_r[node+1];
		}
		if(y[i] == 1)
			p_l[node] = x[i]*m-m+1;
		else
		{
			merge_l(node-1);
			p_l[node] = p_l[node-1];
		}

		for(int start = ans + 1; start <= MaxAns; ++start){
			if(check(start, x[i], y[i]) == false)
				break;
			ans = start;

		}

	}

	rep(i,k)
		printf("%d\n",A[i]);

	return 0;
}


#include <bits/stdc++.h> // sherlock_holmes
using namespace std;

#define LL long long int
#define updateL unsigned long long int

#define imax INT_MAX
#define imin INT_MIN
#define LLmax LLONG_MAX
#define LLmin LLONG_MIN

#define FOR(i,a,b) for(int i= (int)a; i<= (int)b; i++)
#define rep(i,n) for(int i= int(1); i<= (int)n; i++)
#define FORd(i,a,b,d) for(int i=(int)a; i<= (int)b; i+=(int)d)

#define track1() printf("track 1\n");
#define track2() printf("track 2\n");
#define track3() printf("track 3\n");
#define track4() printf("track 4\n");

#define CLR(a) memset(a,0,sizeof(a));
#define SET(a) memset(a,-1,sizeof(a));

#define sz size()
#define pb(x) push_back(x)
#define mp make_pair
#define ii pair<int,int>

#define i4 pair<ii,ii>

#define ll pair<LL,LL>

#define bi pair<bool,int>

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)

#define mod int(1e9 + 7)
#define N int(2000 + 50)

#define si(a) scanf("%d",&a);

#define VI vector<int>
#define VL vector<LL>
#define VS vector<string>
#define VC vector<char>

LL powm(LL a,int b,int n){LL rm=1;while (b){if (b % 2) { rm = (rm * a) % n; }a = (a * a) % n;b /= 2;}return rm;}

char s[N][N];
int x[N], y[N];
vector<i4> squares[N];
int tree[N][N]={0}, max_x, max_y;

void update(int x , int y , int val){
    int y1;
    while (x <= max_x){
        y1 = y;
        while (y1 <= max_y){
            tree[x][y1] += val;
            y1 += (y1 & (-y1));
        }
        x += (x & (-x));
    }
}

int read(int x,int y){ // return sum from 1,1 to x,y.
           int sum= 0;
             while( x){
                  int y1 = y;
                 while(y1){
                     sum += tree[x][y1];
                       y1 -= y1 & (-y1);
                }
                x -= x & (-x);
            }
          return sum;
}

int f1(int r1,int c1,int r2,int c2)
{
	return tree[r2][c2] - tree[r1-1][c2] - tree[r2][c1-1] + tree[r1-1][c1-1];
}

int f2(i4 box)
{
	int r1 = box.F.F, c1 = box.F.S, r2 = box.S.F, c2 = box.S.S;
	return read(r2,c2) - read(r2,c1-1) - read(r1-1,c2) + read(r1-1,c1-1);
}

int main()
{
	int n,m,k;
	si(n); si(m); si(k);
	max_x = n, max_y = m;
	rep(i,n)
		scanf("%s",s[i]);
	rep(i,k)
	{
		si(x[i]); si(y[i]);
	}

	rep(i,n){
		int col = 0;
		rep(j,m){
			if(s[i][j-1] == 'X')
				col ++;
			tree[i][j] = tree[i-1][j] + col;
		}
	}

	int mx;
	for(int i = 1; i <=n ; ++i){
		for(int j = 1; j <= m; ++j){
			mx = min(n-i+1,m-j+1);
			for(int l = 1; l <= mx; ++l){
				if(f1(i,j,i+l-1,j+l-1) == 0){
					squares[l].pb( mp( mp(i,j), mp(i+l-1, j+l-1) ));
				}
			}
		}
	}

	CLR(tree);

	rep(i,n)
		rep(j,m)
			if(s[i][j-1] == 'X')
				update(i, j, +1);

	int pL = min(n, m), pL_k = 0;

	rep(i,k){
		update(x[i], y[i], +1);

		while(pL>0){
			if(pL_k == squares[pL].sz){
				pL--;
				pL_k = 0;
			}
			else if(f2(squares[pL][pL_k]) == 0){
				break;
			}
			else{
				pL_k++;
			}
		}

		printf("%d\n",pL);
		if(pL == 0)
			continue;
	}

	return 0;
}


#include <bits/stdc++.h> // sherlock_holmes
using namespace std;

#define LL long long int
#define updateL unsigned long long int

#define imax INT_MAX
#define imin INT_MIN
#define LLmax LLONG_MAX
#define LLmin LLONG_MIN

#define FOR(i,a,b) for(int i= (int)a; i<= (int)b; i++)
#define rep(i,n) for(int i= int(1); i<= (int)n; i++)
#define FORd(i,a,b,d) for(int i=(int)a; i<= (int)b; i+=(int)d)

#define track1() printf("track 1\n");
#define track2() printf("track 2\n");
#define track3() printf("track 3\n");
#define track4() printf("track 4\n");

#define CLR(a) memset(a,0,sizeof(a));
#define SET(a) memset(a,-1,sizeof(a));

#define sz size()
#define pb(x) push_back(x)
#define mp make_pair
#define ii pair<int,int>

#define i4 pair<ii,ii>

#define ll pair<LL,LL>

#define bi pair<bool,int>

#define F first
#define S second
#define gcd(a,b) __gcd(a,b)

#define mod int(1e9 + 7)
#define N int(2000 + 50)

#define si(a) scanf("%d",&a);

#define VI vector<int>
#define VL vector<LL>
#define VS vector<string>
#define VC vector<char>

LL powm(LL a,int b,int n){LL rm=1;while (b){if (b % 2) { rm = (rm * a) % n; }a = (a * a) % n;b /= 2;}return rm;}

char s[N][N];
int x[N], y[N];
vector<i4> squares[N];
int tree[N][N]={0}, max_x, max_y, n, m, k;
bool cd = false;

int p_r[N * N], p_l[N * N];

int merge_r(int node)
{
	if(p_r[node] == node)
		return node;
	p_r[node] = merge_r(p_r[node]);
	return p_r[node];
}

int merge_l(int node)
{
	if(p_l[node] == node)
		return node;
	p_l[node] = merge_l(p_l[node]);
	return p_l[node];
}

int f1(int r1,int c1,int r2,int c2)
{
	return tree[r2][c2] - tree[r1-1][c2] - tree[r2][c1-1] + tree[r1-1][c1-1];
}

int A[N]={0};

int ff(int node)
{
	if(node%m == 0)
		return m;
	return node%m;
}

bool check(int l,int rr,int cc)
{
	int r1 = rr, r2 = rr, col, leftBar, rightBar, row, del;

	while(r1>1){
		if(s[r1 - 1][cc - 1] == '.')
			r1--;
		else
			break;
	}
	while(r2 < n)
		if(s[r2+1][cc - 1] == '.')
			r2++;
		else
			break;

	if(r2 - r1 + 1 < l)
		return false;

	deque<ii> myset_l, myset_r;

	for(int i = r1; i <= r2; ++i){
		merge_l(i*m-m+cc); // get-max
		merge_r(i*m-m+cc); // get-min
		col = ff(p_l[i*m-m + cc]);

		if(s[i][col-1] == 'X')
			col++;
		while(!myset_l.empty()){
			if(myset_l.back().S <= col)
				myset_l.pop_back();
			else
				break;
		}
		myset_l.push_back(mp(i, col));

		col = ff(p_r[i*m-m + cc]);
		if(s[i][col-1] == 'X')
			col--;

		while(!myset_r.empty()){
			if(myset_r.back().S >= col)
				myset_r.pop_back();
			else
				break;
		}
		myset_r.push_back(mp(i, col));

		if(i >= r1 + l - 1){
			if( myset_r.front().S - myset_l.front().S  + 1 >= l)
				return true;
			row = i - l + 1;

			while(!myset_l.empty()){
				if(myset_l.front().F <= row){
					myset_l.pop_front();
				}
				else
					break;
			}

			while(!myset_r.empty()){
				if(myset_r.front().F <= row){
					myset_r.pop_front();
				}
				else
					break;
			}
		}

	}
	return false;
}

int main()
{

	si(n); si(m); si(k);
	max_x = n, max_y = m;
	rep(i,n)
		scanf("%s",s[i]);
	rep(i,k)
	{
		si(x[i]); si(y[i]);
		s[x[i]][y[i]-1] = 'X';
	}

	rep(i,n){
		int col = 0;
		rep(j,m){
			if(s[i][j-1] == 'X')
				col ++;
			tree[i][j] = tree[i-1][j] + col;
		}
	}

	int mx, ans = 0;
	for(int i = 1; i <=n ; ++i){
		for(int j = 1; j <= m; ++j){
			mx = min(n-i+1,m-j+1);
			for(int l = ans+1; l <= mx; ++l){
				if(f1(i,j,i+l-1,j+l-1) == 0){
					ans = l;
				}
				else
					break;
			}
		}
	}

	rep(i,n){
		int bfr = 1;
		for(int j =1 ; j <=m ; ++j){
			if(s[i][j-1] == 'X')
				bfr = j;
			p_l[i*m-m+j] = (i-1)*m + bfr;
		}
	}

	rep(i,n){
		int last = m;
		for(int j = m; j >=1; j--){
			if(s[i][j-1] == 'X')
				last = j;
			p_r[i*m-m+j] = (i-1)* m + last;
		}
	}
	A[k] = ans;

	int MaxAns = min(n,m), node;

	for(int i = k; i >=1 ; i--){
		A[i] = ans;
	//	cout << i << " -->>  " << A[i] << endl;

		s[x[i]][y[i] - 1] = '.';
		node = x[i]*m-m+y[i];
		if(y[i] == m)
			p_r[node] = x[i]*m;
		else
		{
			merge_r(node+1);
			p_r[node] = p_r[node+1];
		}
		if(y[i] == 1)
			p_l[node] = x[i]*m-m+1;
		else
		{
			merge_l(node-1);
			p_l[node] = p_l[node-1];
		}

		for(int start = ans + 1; start <= MaxAns; ++start){
			if(check(start, x[i], y[i]) == false)
				break;
			ans = start;

		}

	}

	rep(i,k)
		printf("%d\n",A[i]);

	return 0;
}


#include <bits/stdc++.h>

#define db 	cout << "*****" << endl;
#define Max 2009
#define pb push_back
#define pp pop_back
#define ff first
#define ss second
#define mk make_pair
#define MOD 1000000007

using namespace std;

int n,m,q;

int arr[Max][Max];
int down[Max][Max];
int up[Max][Max];
int ans[Max];

pair < int , int > data[Max];

priority_queue < pair< int , int > , vector < pair < int , int > > , greater < pair < int , int > > > lft , rght , h;

bool check( int pos , int val ){

	//cout << pos << "  "<< val << endl;
	lft = h;
	rght = h;

	for( int j=1;j<=m;j++){

		lft.push({ up[pos][j] , j });
		rght.push({down[pos][j] , j });

		while( lft.top().ss <=  j - val ) lft.pop();
		while( rght.top().ss <=  j - val ) rght.pop();

		if( j >= val && lft.top().ff + rght.top().ff - 1 >= val  )
			return 1;
	}
	return 0;
}
char s[Max];

int main(){

	scanf("%d%d%d" ,&n,&m,&q);
	char s[Max];

	for( int i=1;i<=n;i++){
		scanf("%s" ,s );

		for( int j=1;j<=m;j++)
			arr[i][j] = ( s[j-1] == '.' );
	}
	for( int i=1;i<=q;i++){
		int a,b;
		scanf("%d%d" ,&a,&b);
		arr[a][b] = 0 ;
		data[i] = { a , b };
	}
	for( int i=1;i<=n;i++)
		for( int j=1;j<=m;j++)
			up[i][j] = up[i-1][j] * arr[i][j] + arr[i][j];

	for( int i=n;i>=1;i--)
		for( int j=1;j<=m;j++)
			down[i][j] = down[i+1][j] * arr[i][j] + arr[i][j];

	int val=0;

	for( int i=1;i<=n;i++)
		while( check( i , val + 1 ) )
			val++;

	for( int i=q;i>=1;i--){
		ans[i] = val;
		int a,b;
		a = data[i].ff;
		b = data[i].ss;

		arr[a][b] = 1;

		for( int j=1;j<=n;j++)
			up[j][b] = up[j-1][b] * arr[j][b] + arr[j][b];

		for( int j=n;j>=1;j--)
			down[j][b] = down[j+1][b] * arr[j][b] + arr[j][b];

		while( check(a , val + 1 ) )
			val++;

	}

	for( int i=1;i<=q;i++)
		printf("%d\n" , ans[i]);

	return 0;
}


#include <bits/stdc++.h>

#define db 	cout << "*****" << endl;
#define Max 2009
#define pb push_back
#define pp pop_back
#define ff first
#define ss second
#define mk make_pair
#define MOD 1000000007

using namespace std;

int n,m,q;

int arr[Max][Max];
int down[Max][Max];
int up[Max][Max];
int ans[Max];

pair < int , int > data[Max];

priority_queue < pair< int , int > , vector < pair < int , int > > , greater < pair < int , int > > > lft , rght , h;

bool check( int pos , int val ){

	//cout << pos << "  "<< val << endl;
	lft = h;
	rght = h;

	for( int j=1;j<=m;j++){

		lft.push({ up[pos][j] , j });
		rght.push({down[pos][j] , j });

		while( lft.top().ss <=  j - val ) lft.pop();
		while( rght.top().ss <=  j - val ) rght.pop();

		if( j >= val && lft.top().ff + rght.top().ff - 1 >= val  )
			return 1;
	}
	return 0;
}
int main(){

	scanf("%d%d%d" ,&n,&m,&q);
	for( int i=1;i<=n;i++){
		for( int j=1;j<=m;j++){
			char c;
			cin >> c;
			arr[i][j] = ( c == '.' );
		}
	}
	for( int i=1;i<=q;i++){
		int a,b;
		scanf("%d%d" ,&a,&b);
		arr[a][b] = 0 ;
		data[i] = { a , b };
	}
	for( int i=1;i<=n;i++)
		for( int j=1;j<=m;j++)
			up[i][j] = up[i-1][j] * arr[i][j] + arr[i][j];

	for( int i=n;i>=1;i--)
		for( int j=1;j<=m;j++)
			down[i][j] = down[i+1][j] * arr[i][j] + arr[i][j];

	int val=0;

	for( int i=1;i<=n;i++)
		while( check( i , val + 1 ) )
			val++;

	for( int i=q;i>=1;i--){
		ans[i] = val;
		int a,b;
		a = data[i].ff;
		b = data[i].ss;

		arr[a][b] = 1;

		for( int j=1;j<=n;j++)
			up[j][b] = up[j-1][b] * arr[j][b] + arr[j][b];

		for( int j=n;j>=1;j--)
			down[j][b] = down[j+1][b] * arr[j][b] + arr[j][b];

		while( check(a , val + 1 ) )
			val++;

	}

	for( int i=1;i<=q;i++)
		cout << ans[i] << "\n";

	return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <queue>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <bitset>

using namespace std;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define epr(...) fprintf(stderr, __VA_ARGS__)
#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define all(a) (a).begin(), (a).end()

#define equal equalll
#define less lesss
const int N = 2111;
const long long INF = 1e9 + 19;

int n, m, k;
int board[N][N];
char s[N][N];
pair < int, int > add[N];
int pref[N][N];
int answer[N];
int dp[N][N];
int p[N * N];
int l[N * N];
int r[N * N];
int LUp[N];
int RUp[N];
int LDown[N];
int RDown[N];

void read() {
    scanf("%d%d%d", &n, &m, &k);
    for (int i = 0; i < n; i++)
        scanf("%s", s[i]);
    for (int i = 0; i < k; i++) {
        scanf("%d%d", &add[i].fr, &add[i].sc);
        add[i].fr--;
        add[i].sc--;
    }

}

int getPos(int x, int y) {
    return x * m + y;
}

int getSum(int x0, int y0, int x1, int y1) {
    return pref[x1][y1] - pref[x0][y1] - pref[x1][y0] + pref[x0][y0];
}

int getId(int v) {
    return (p[v] == v)? v: p[v] = getId(p[v]);
}

void merge(int v, int u) {
    v = getId(v);
    u = getId(u);
    p[v] = u;
    l[u] = min(l[u], l[v]);
    r[u] = max(r[u], r[v]);
}

void getLR(int x, int y, int & L, int & R) {
    if (board[x][y] == 1) {
        L = m;
        R = -1;
        return;
    }
    int v = getPos(x, y);
    v = getId(v);
    L = l[v];
    R = r[v];
}

void solve() {
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            board[i][j] = s[i][j] == 'X';

    for (int i = 0; i < k; i++) {
        assert(board[add[i].fr][add[i].sc] == 0);
        board[add[i].fr][add[i].sc] = 1;
    }

    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            pref[i + 1][j + 1] = pref[i + 1][j] + pref[i][j + 1] - pref[i][j] + board[i][j];

    int mx = 0;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++) {
            for (;; ) {
                int r = dp[i][j] + 1;
                if (i + r <= n && j + r <= m && getSum(i, j, i + r, j + r) == 0)
                    dp[i][j]++;
                else
                    break;
            }
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j] - 1);
            dp[i][j + 1] = max(dp[i][j + 1], dp[i][j] - 1);
            mx = max(dp[i][j], mx);
        }

    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++) {
            int id = getPos(i, j);
            p[id] = id;
            l[id] = j;
            r[id] = j;
        }

    for (int i = 0; i < n; i++)
        for (int j = 0; j < m - 1; j++)
            if (board[i][j] == 0 && board[i][j + 1] == 0) {
                merge(getPos(i, j), getPos(i, j + 1));
            }
    //for (int i = 0; i < n; i++, cerr << endl)
        //for (int j = 0; j < m; j++)
            //cerr << board[i][j] << " ";
    //cerr << endl;
    //for (int i = 0; i < n; i++, cerr << endl)
        //for (int j = 0; j < m; j++)
            //cerr << getId(getPos(i, j)) << " ";
    //cerr << endl;
    //for (int i = 0; i < n; i++, cerr << endl)
        //for (int j = 0; j < m; j++)
            //cerr << r[getId(getPos(i, j))] << " ";
    int ll, rr;
    getLR(3, 7, ll, rr);
    //db2(n, m);
    //db2(ll, rr);

    answer[k - 1] = mx;
    for (int t = k - 1; t >= 1; t--) {
        //db(t);
        int x = add[t].fr;
        int y = add[t].sc;
        assert(board[x][y] == 1);
        board[x][y] = 0;
        if (y > 0 && board[x][y - 1] == 0)
            merge(getPos(x, y - 1), getPos(x, y));
        if (y + 1 < m && board[x][y + 1] == 0)
            merge(getPos(x, y + 1), getPos(x, y));

        for (;;) {
            int up = max(0, x - mx);
            int down = min(x + mx, n - 1);
            int mxL = 0;
            int mnR = m;
            //db2(x, y);
            //db2(up, down);
            //db(mx);
            for (int i = x; i >= up; i--) {
                int left, right;
                getLR(i, y, left, right);
                mxL = max(mxL, left);
                mnR = min(mnR, right);
                LUp[i] = mxL;
                RUp[i] = mnR;
            }
            mxL = 0;
            mnR = m;
            for (int i = x; i <= down; i++) {
                int left, right;
                getLR(i, y, left, right);
                mxL = max(mxL, left);
                mnR = min(mnR, right);
                LDown[i] = mxL;
                RDown[i] = mnR;
            }
            //for (int i = 0; i < n; i++)
                //db2(LUp[i], RUp[i]);
            //cerr << endl;
            //for (int i = 0; i < n; i++)
                //db2(LDown[i], RDown[i]);
            bool flag = 0;
            for (int i = x; i >= up; i--) {
                int dd = i + mx;
                //db2(dd, x);
                assert(dd >= x);
                if (dd > down) continue;
                mxL = max(LUp[i], LDown[dd]);
                mnR = min(RUp[i], RDown[dd]);
                if (mnR - mxL >= mx)
                    flag = 1;
            }
            if (!flag) break;
            mx++;
        }

        answer[t - 1] = mx;
    }
    for (int i = 0; i < k; i++)
        printf("%d\n", answer[i]);

}

void printAns() {

}

void stress() {

}

int main(){
#ifdef DEBUG
    freopen("in", "r", stdin);
    //freopen("out", "w", stdout);
#endif
    if (1) {
        int k = 1;
        for (int tt = 0; tt < k; tt++) {
            read();
            solve();
            printAns();
        }
    }
    else {
        stress();
    }

    return 0;
}