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

int main(){

    int n,k;
    cin>>n>>k;

    int *a = new int[n];

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

    sort(a,a+n);

    int cnt = 0;

    if(n<3)
        cout<<0;
    else{
        for(int i=0 ; i<n ; i+=3){

            int check = 5-k;
            bool flag = false;

            for(int j=0 ; j<3 ; j++){
                if(a[i+j] > check){
                    flag = false;
                    break;
                }
                else
                    flag = true;
            }

            if(flag)
                cnt++;
        }
    }

    cout<<cnt;

    return 0;
}


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

int main(){

    int n,k;
    cin>>n>>k;

    int *a = new int[n];

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

    sort(a,a+n);

    int cnt = 0;

    if(n<3)
        cout<<0;
    else{

        int m = n/3;
        for(int i=0 , l=0 ; i<n && l<m ; i+=3 , l++){

            int check = 5-k;
            bool flag = false;

            for(int j=0 ; j<3 ; j++){
                if(a[i+j] > check){
                    flag = false;
                    break;
                }
                else
                    flag = true;
            }

            if(flag)
                cnt++;
        }
    }

    cout<<cnt;

    return 0;
}


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

int main(){

    int n,k;
    cin>>n>>k;

    int *a = new int[n];

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

    sort(a,a+n);

    int cnt = 0;

    if(n<3)
        cout<<0;
    else{

        int m = n/3;
        for(int i=0 , l=0 ; i<n && l<m ; i+=3 , ls++){

            int check = 5-k;
            bool flag = false;

            for(int j=0 ; j<3 ; j++){
                if(a[i+j] > check){
                    flag = false;
                    break;
                }
                else
                    flag = true;
            }

            if(flag)
                cnt++;
        }
    }

    cout<<cnt;

    return 0;
}


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

int main(){

    int n,k;
    cin>>n>>k;

    int *a = new int[n];

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

    sort(a,a+n);

    int cnt = 0;

    if(n<3)
        cout<<0;
    else{

        int m = n/3;
        for(int i=0 , l=0 ; i<n && l<m ; i+=3 , l++){

            int check = 5-k;
            bool flag = false;

            for(int j=0 ; j<3 ; j++){
                if(a[i+j] > check){
                    flag = false;
                    break;
                }
                else
                    flag = true;
            }

            if(flag)
                cnt++;
        }

        cout<<cnt;
    }

    return 0;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
using namespace std;
int i,n,k,m,a[1000];
main(){
	cin>>n>>k;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n;i++){
		if(5-k>=a[i])m++;
	}
	cout<<m/3;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
using namespace std;
int i,n,k,m,a[1000];
main(){
	cin>>n>>k;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n;i++){
		if(a[i]<=5-k)m++;
	}
	cout<<m/3;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
using namespace std;
int i,n,k,m,a[1000000];
main(){
	cin>>n>>k;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n;i++){
		if(a[i]<=5-k)m++;
	}
	cout<<m/3;
}


#include <bits/stdc++.h>
#define int long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
using namespace std;
int i,n,k,m,a[1000];
main(){
	cin>>n>>k;
	for(i=1;i<=n;i++){
		cin>>a[i];
	}
	for(i=1;i<=n;i++){
		if(5-k>=a[i])m++;
	}
	cout<<m/3;
}


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

int main() {
	int k,n;
	cin>>n>>k;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		a[i]=a[i]+k;
	}
	sort(a,a+n);
	int c=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]<=5)
			c++;
	}
	cout<<c/3<<endl;
	return 0;
}


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

int main() {
	int k,n;
	cin>>k>>n;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		a[i]=a[i]+k;
	}
	sort(a,a+n);
	int c=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]<=5)
			c++;
	}
	cout<<c/3<<endl;
	return 0;
}


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

int main() {
	int k,n;
	cin>>k>>n;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		a[i]=a[i]+k;
	}
	sort(a,a+n);
	int c=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]<=5)
			c++;
		else
			break;
	}
	cout<<c/k<<endl;
	return 0;
}


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

int main() {
	int k,n;
	cin>>k>>n;
	int a[n];
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		a[i]=a[i]+k;
	}
	sort(a,a+n);
	int c=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]<=5)
			c++;
		else
			break;
	}
	cout<<c/3<<endl;
	return 0;
}


#include<bits/stdc++.h>
#define all(v)      ((v).begin()),  ((v).end())
#define sz(v)        ((int)((v).size()))
typedef long long ll;
using namespace std;
int main(void) {
	int n,k,c=0;
	cin>>n>>k;

	for(int i=0;i<n;++i){
		int x;
		cin>>x;
		x=5-x;
		if(x>=k)
			++c;
	}
	cout<<c/3;

	return 0;
}


#include <bits/stdc++.h>

using namespace std;
int arr[111];
int main()
{
    int n,k,cnt=0;
    cin>>n>>k;
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
        if(arr[i]*k<=5&&arr[i]+k<=5)
        {
            cnt++;
        }
    }
    cout<<cnt/3;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int arr[111];
int main()
{
    int n,k,cnt=0;
    cin>>n>>k;
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
        if(arr[i]*k<=5&&arr[i]+k>=k)
        {
            cnt++;
        }
    }
    cout<<cnt/3;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int arr[2002];
int main()
{
    int n,k,cnt=0;
    cin>>n>>k;
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
        if(arr[i]+k<=5)
        {
            cnt++;
        }
    }
    cout<<cnt/3;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int arr[111];
int main()
{
    int n,k,cnt=0;
    cin>>n>>k;
    for(int i=0; i<n; i++)
    {
        cin>>arr[i];
        if(arr[i]*k<=5)
        {
            cnt++;

        }
    }
    cout<<cnt/3;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){

int n,k,cnt=0,x;
 cin>>n>>k;
 int a[n];

 for(int i=0;i<n;i++){
    cin>>x;
    a[i] = x+k; }

 for(int i=0;i<n;i++)
 {
    if(a[i] <= 5){
        cnt++;
    }
 }

 int ans = cnt/3;

 if(ans > 0){
    cout<<ans<<endl;
 }
 else cout<<"0"<<endl;

return 0;
}


#include <bits/stdc++.h>
#include <vector>

using namespace std;

int main(){

    int n,k,x,cnt=0;

    cin>>n;
    cin>>k;

vector<int>v;

  for(int i=0;i<n;i++){
        cin>>x;
    v.push_back(x);
  }

  sort(v.begin(),v.end());

  for(int i=0;i<n;i++){

   v[i] += k;
  }

   for(int i=0;i<n;i++){
        //cout<<"inside for loop"<<endl;
        if(v[i]<=5){
            //cout<<"inside if"<<endl;
            cnt++;
        }
   }

 int ans = cnt/3;

 cout<<ans<<endl;

 return 0;
}


#include <bits/stdc++.h>
#include <vector>

using namespace std;

int main(){

    int n,k,x,cnt=0;

    cin>>n;
    cin>>k;

vector<int>v;

  for(int i=0;i<n;i++){
        cin>>x;
    v.push_back(x);
  }

  sort(v.begin(),v.end());

  for(int i=0;i<n;i++){

   v[i] += k;
  }

   for(int i=0;i<n;i++){
        //cout<<"inside for loop"<<endl;
        if(v[i]<5){
            //cout<<"inside if"<<endl;
            cnt++;
        }
   }

 int ans = cnt/3;

 cout<<ans<<endl;

 return 0;
}


#include <bits/stdc++.h>
#include <vector>

using namespace std;

int main(){

    int n,k,x,cnt=0;

    cin>>n;
    cin>>k;

vector<int>v;

  for(int i=0;i<n;i++){
        cin>>x;
    v.push_back(x);
  }

  sort(v.begin(),v.end());

  for(int i=0;i<n;i++){

   v[i] += k;
  }

  for(int i=0;i<n;i++){
    cout<<v[i]<<" ";
  }

   for(int i=0;i<n;i++){
        //cout<<"inside for loop"<<endl;
        if(v[i]<5){
            //cout<<"inside if"<<endl;
            cnt++;
        }
   }

 int ans = cnt/3;

 cout<<ans<<endl;

 return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(int i = (a), _b = (b); i <= _b; i++)
#define FORE(i,a,b) for(int i = (a), _b = (b); i >= _b; i--)

using namespace std;

typedef pair<int, int> II;

int main()
{   int n,k,a[10010];
    ios::sync_with_stdio();
   // freopen("inp.txt", "r", stdin);
    cin>>n>>k;
    FOR(i,1,n) cin>>a[i];
    sort(a+1,a+1+n);
    if(a[n]==5-k) cout<<(n/3); else {
    //FOR(i,1,n) cout<<a[i]<<" ";
    int dau = 1, cuoi = n, mid;
        while (dau < cuoi) {
            mid = (dau + cuoi) >> 1;
            if (a[mid] >= 5-k+1 ) cuoi = mid-1;
            else dau = mid+1;
        }
      // cout<<dau<<endl;

    if(dau-1>=3) {cout<<(dau-1)/3;} else cout<<"0";
    }
    return 0;

}


#include <bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(int i = (a), _b = (b); i <= _b; i++)
#define FORE(i,a,b) for(int i = (a), _b = (b); i >= _b; i--)

using namespace std;

typedef pair<int, int> II;

int main()
{   int n,k,a[100];
    ios::sync_with_stdio();
   // freopen("inp.txt", "r", stdin);
    cin>>n>>k;
    FOR(i,1,n) cin>>a[i];
    sort(a+1,a+1+n);
    if(a[n]==5-k) cout<<(n/3); else {
    //FOR(i,1,n) cout<<a[i]<<" ";
    int dau = 1, cuoi = n, mid;
        while (dau < cuoi) {
            mid = (dau + cuoi) >> 1;
            if (a[mid] >= 5-k ) cuoi = mid-1;
            else dau = mid+1;
        }
      //  cout<<dau<<endl;
    if(dau-1>=3) {cout<<(dau-1)/2;} else cout<<"0";
    }
    return 0;

}


#include <bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(int i = (a), _b = (b); i <= _b; i++)
#define FORE(i,a,b) for(int i = (a), _b = (b); i >= _b; i--)

using namespace std;

typedef pair<int, int> II;

int main()
{   int n,k,a[100];
    ios::sync_with_stdio();
   // freopen("inp.txt", "r", stdin);
    cin>>n>>k;
    FOR(i,1,n) cin>>a[i];
    sort(a+1,a+1+n);
    if(a[n]==5-k) cout<<(n/3); else {
    //FOR(i,1,n) cout<<a[i]<<" ";
    int dau = 1, cuoi = n, mid;
        while (dau < cuoi) {
            mid = (dau + cuoi) >> 1;
            if (a[mid] >= 5-k ) cuoi = mid-1;
            else dau = mid+1;
        }
      //  cout<<dau<<endl;
    if(dau>=3) {cout<<(dau-1)/2;} else cout<<"0";
    }
    return 0;

}


#include <bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(int i = (a), _b = (b); i <= _b; i++)
#define FORE(i,a,b) for(int i = (a), _b = (b); i >= _b; i--)

using namespace std;

typedef pair<int, int> II;

int main()
{   int n,k,a[100];
    ios::sync_with_stdio();
   // freopen("inp.txt", "r", stdin);
    cin>>n>>k;
    FOR(i,1,n) cin>>a[i];
    sort(a+1,a+1+n);
    if(a[n]==5-k) cout<<(n/3); else {
    //FOR(i,1,n) cout<<a[i]<<" ";
    int dau = 1, cuoi = n, mid;
        while (dau < cuoi) {
            mid = (dau + cuoi) >> 1;
            if (a[mid] >= 5-k ) cuoi = mid-1;
            else dau = mid+1;
        }
      //  cout<<dau<<endl;
    cout<<(dau-1)/2;
    }
    return 0;

}


#include <bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(int i = (a), _b = (b); i <= _b; i++)
#define FORE(i,a,b) for(int i = (a), _b = (b); i >= _b; i--)

using namespace std;

typedef pair<int, int> II;

int main()
{   int n,k,a[100];
    ios::sync_with_stdio();
   // freopen("inp.txt", "r", stdin);
    cin>>n>>k;
    FOR(i,1,n) cin>>a[i];
    sort(a+1,a+1+n);
    if(a[n]==5-k) cout<<(n/3); else {
    //FOR(i,1,n) cout<<a[i]<<" ";
    int dau = 1, cuoi = n, mid;
        while (dau < cuoi) {
            mid = (dau + cuoi) >> 1;
            if (a[mid] >= 5-k+1 ) cuoi = mid-1;
            else dau = mid+1;
        }
      // cout<<dau<<endl;

    if(dau-1>=3) {cout<<(dau-1)/3;} else cout<<"0";
    }
    return 0;

}


#include <bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(int i = (a), _b = (b); i <= _b; i++)
#define FORE(i,a,b) for(int i = (a), _b = (b); i >= _b; i--)

using namespace std;

typedef pair<int, int> II;

int main()
{   int n,k,a[10010];
    ios::sync_with_stdio();
   // freopen("inp.txt", "r", stdin);
    cin>>n>>k;
    FOR(i,1,n) cin>>a[i];
    sort(a+1,a+1+n);
    if(a[n]==5-k) cout<<(n/3); else {
    //FOR(i,1,n) cout<<a[i]<<" ";
    int dau = 1, cuoi = n, mid;
        while (dau <= cuoi) {
            mid = (dau + cuoi) >> 1;
            if (a[mid] >= 5-k+1 ) cuoi = mid-1;
            else dau = mid+1;
        }
      // cout<<dau<<endl;

    if(dau-1>=3) {cout<<(dau-1)/3;} else cout<<"0";
    }
    return 0;

}


#include <bits/stdc++.h>
using namespace std;
int n,k,x[2005],v;
int main(){
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x[i];
    }
  sort(x,x+n);
  for(int i=1; i<=n; i++){
      if(x[i]<=5){
          if(x[i]<=5-k){
              v++;
          }
      }

      if(x[i]>5-k){
          break;
      }

  }

    cout<<v;
}


#include <bits/stdc++.h>
using namespace std;
int n,k,x[2005],v,r;
int main(){
    cin>>n>>k;
    for(int i=1; i<=n; i++){
        cin>>x[i];
    }
  sort(x,x+n);
  for(int i=1; i<=n; i++){
      if(x[i]<=5){
          if(x[i]<=5-k){
              v++;
          }
      }

      if(x[i]>5-k){
          break;
      }

  }
    r=v/3;
    cout<<r;
}


#include <bits/stdc++.h>
using namespace std;
int n,k,x[2005],v;
int main(){
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x[i];
    }
  sort(x,x+n);
  for(int i=1; i<=n; i++){

          if(x[i]<=5-k){
              v++;
          }

  }

    cout<<v;
}


#include <bits/stdc++.h>
using namespace std;
int n,k,x[2005],v,r;
int main(){
    cin>>n>>k;
    for(int i=0; i<n; i++){
        cin>>x[i];
    }
  sort(x,x+n);
  for(int i=0; i<n; i++){
      if(x[i]<=5){
          if(x[i]<=5-k){
              v++;
          }
      }

      if(x[i]>5-k){
          break;
      }

  }
    r=v/3;
    cout<<r;
}


#include <bits/stdc++.h>
using namespace std;
int n,k,x[2005],v;
int main(){
    cin>>n;
    for(int i=1; i<=n; i++){
        cin>>x[i];
    }
  sort(x,x+n);
  for(int i=1; i<=n; i++){
      if(x[i]<=5){
          if(x[i]<=5-k){
              v++;
          }
      }

  }

    cout<<v;
}


#include <bits/stdc++.h>

using namespace std;

//  pair < int, int > pa[260000];
//   vector <int> b (1001, 0);
//  vector <long long> a (100001, 0);
//  long long f[100021];
//vector <long long> a (100001, 0);
// printf("%.9f", minn);
int main () {
      freopen("input.txt","r",stdin);
      freopen("output.txt","w",stdout);
    int n,k;
    int v=-1;
    int a[10000];

    int x;
    cin >> n >> k;
    for (int i(0); i<n; i++){
        cin >> x;
        if (x<5) {v++; a[v]=x;}
}
    sort(a,a+v);
    int now=0;
    int ot=0;
   // cout << v << endl;
    while (now+2<=v){
        if(k<=5-max(max(a[now],a[now+1]),a[now+2]))
            ot++;
        now+=3;
//cout << a[now] << " " << a[now+1] << endl;
    }
    cout << ot << endl;
}


#include <bits/stdc++.h>

using namespace std;

//  pair < int, int > pa[260000];
//   vector <int> b (1001, 0);
//  vector <long long> a (100001, 0);
//  long long f[100021];
//vector <long long> a (100001, 0);
// printf("%.9f", minn);
int main () {
   //   freopen("input.txt","r",stdin);
    //  freopen("output.txt","w",stdout);
    int n,k;
    int v=-1;
    int a[10000];

    int x;
    cin >> n >> k;
    for (int i(0); i<n; i++){
        cin >> x;
        if (x<5) {v++; a[v]=x;}
}
    sort(a,a+v);
    int now=0;
    int ot=0;
   // cout << v << endl;
    while (now+2<=v){
        if(k<=5-max(max(a[now],a[now+1]),a[now+2]))
            ot++;
        now+=3;
//cout << a[now] << " " << a[now+1] << endl;
    }
    cout << ot << endl;
}


#include <bits/stdc++.h>

using namespace std;

//  pair < int, int > pa[260000];
//   vector <int> b (1001, 0);
//  vector <long long> a (100001, 0);
//  long long f[100021];
//vector <long long> a (100001, 0);
// printf("%.9f", minn);
int main () {
    //  freopen("input.txt","r",stdin);
    //  freopen("output.txt","w",stdout);
    int n,k;
    int v=-1;
    int a[10000];

    int x;
    cin >> n >> k;
    for (int i(0); i<n; i++){
        cin >> x;
        if (x<5) {v++; a[v]=x;}
}
    v++;
    sort(a,a+v);
    int now=0;
    int ot=0;
   // cout << v << endl;
    while (now+2<=v){
        if(k<=5-max(max(a[now],a[now+1]),a[now+2]))
            ot++;
//cout << a[now] << " " << a[now+1] << endl;
        now+=3;
    }
    cout << ot << endl;
}


#include <bits/stdc++.h>

using namespace std;

//  pair < int, int > pa[260000];
//   vector <int> b (1001, 0);
//  vector <long long> a (100001, 0);
//  long long f[100021];
//vector <long long> a (100001, 0);
// printf("%.9f", minn);
int main () {
    //  freopen("input.txt","r",stdin);
    //  freopen("output.txt","w",stdout);
    int n,k;
    int v=-1;
    int a[10000];

    int x;
    cin >> n >> k;
    for (int i(0); i<n; i++){
        cin >> x;
        if (x<5) {v++; a[v]=x;}
}
    v++;
    sort(a,a+v);
    int now=0;
    int ot=0;
   // cout << v << endl;
    while (now+2<v){
        if(k<=5-max(max(a[now],a[now+1]),a[now+2]))
            ot++;
//cout << a[now] << " " << a[now+1] << endl;
        now+=3;
    }
    cout << ot << endl;
}


#include <bits/stdc++.h>

using namespace std;

//  pair < int, int > pa[260000];
//   vector <int> b (1001, 0);
//  vector <long long> a (100001, 0);
//  long long f[100021];
//vector <long long> a (100001, 0);
// printf("%.9f", minn);
int main () {
    //  freopen("input.txt","r",stdin);
    //  freopen("output.txt","w",stdout);
    int n;
    int a=0,b=0;

    int x;
    for (int i(0); i<3; i++){
        cin >> x;
        if (x<5) b++;
}
cout << x/3 << endl;

}


#include <bits/stdc++.h>

using namespace std;

//  pair < int, int > pa[260000];
//   vector <int> b (1001, 0);
//  vector <long long> a (100001, 0);
//  long long f[100021];
//vector <long long> a (100001, 0);
// printf("%.9f", minn);
int main () {
  //    freopen("input.txt","r",stdin);
  //    freopen("output.txt","w",stdout);
    int n,k;
    int v=-1;
    int a[10000];

    int x;
    cin >> n >> k;
    for (int i(0); i<n; i++){
        cin >> x;
        if (x<5) {v++; a[v]=x;}
}
    sort(a,a+v);
    int now=0;
    int ot=0;
   // cout << v << endl;
    while (now<=v){
        if(k<=5-max(max(a[now],a[now+1]),a[now+2]))
            ot++;
        now+=3;
//cout << a[now] << " " << a[now+1] << endl;
    }
    cout << ot << endl;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
       arr[i]+=k;
   }
   int count=0;
   for(int i=0;i<n;i++)
   {
       if(arr[i]<=5)
       {
           count++;
       }
   }
   cout<<count/3<<"\n";
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
       arr[i]+=k;
   }
   int count=0;
   for(int i=0;i<n;i++)
   {
       if(arr[i]<=5
       count++;
   }
   cout<<count/3<<endl;
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
   }
   sort(arr,arr+n);
   int count=0;
   for(int i=0;i<n;i++)
   {
       int res=arr[i]+arr[i+1]+arr[i+2];
       if((res+k)<=5)
       {
           count++;
       }
   }
   cout<<count<<"\n";
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
       arr[i]+=k;
   }
   int count=0;
   for(int i=0;i<n;i++)
   {
       if(arr[i]<=5)
       count++;
   }
   int ans=count/3;
   cout<<ans<<endl;
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
//	int t;
//	cin>>t;
//	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
   }
   sort(arr,arr+n);
   int count=0;
   for(int i=0;i<n;i++)
   {
       int res=arr[i]+arr[i+1]+arr[i+2];
       if((res+k)<5)
       {
           count++;
       }
   }
   cout<<count/3<<"\n";
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
   }
   sort(arr,arr+n);
   int count=0;
   for(int i=0;i<n;i+=3)
   {
       int res=arr[i]+arr[i+1]+arr[i+2];
       if((res+k)<=5)
       {
           count++;
       }
   }
   cout<<count<<"\n";
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
       arr[i]+=k;
   }
   int count=0;
   for(int i=0;i<n;i++)
   {
       if(arr[i]<=5)
       count++;
   }
   int ans=count/3;
   cout<<ans<<endl;
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
//	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
   }
   sort(arr,arr+n);
   int count=0;
   for(int i=0;i<n;i++)
   {
       int res=arr[i]+arr[i+1]+arr[i+2];
       if((res+k)<=5)
       {
           count++;
       }
   }
   cout<<count<"\n";
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
       arr[i]+=k;
   }
   sort(arr,arr+n);
   int count=0;
   for(int i=0;i<n;i++)
   {
       if(arr[i]<=5)
       {
           count++;
       }
   }
   cout<<count/3<<"\n";
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
   }
   sort(arr,arr+n);
   int count=0;
   for(int i=0;i<n;i++)
   {
       int res=arr[i]+arr[i+1]+arr[i+2];
       if((res+k)<5)
       {
           count++;
       }
   }
   cout<<count<<"\n";
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
       arr[i]+=k;
   }
   int count=0;
   for(int i=0;i<n;i++)
   {
       if(arr[i]<=5)
       count++;
   }
   cout<<count/3<<endl;
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


//
//  AUTHOR : chirantan_2001
//
/*************************************/
#include<bits/stdc++.h>

#define AU auto
#define ll  long long
#define ull unsigned long long
#define ld long double
#define lf long float
#define vi vector<int>
#define vll vector<long long>
#define vb vector<bool>
#define loop(i,n) for(long long i=0;i<n;i++)
#define loopn(i,a,b) for(long long i=a;i<=b;i++)
#define rloop(i,n) for(long long i=n;i>0;i--)
#define sortv(a) sort(a.begin(),a.end())
#define be(a) (a.begin(),a.end())
#define pb push_back
#define pf push_front

using namespace std;

const ll MOD=1000000007;
long long max(long long a,long long b){if(b<=a)return a;else return b;}
long long min(long long a,long long b){if(b<=a)return b;else return a;}
long long fact(long long a){long long f=1;for(long long i=1;i<=a;i++)f=(f*i);return f;}
void FASTIO(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);}

/****************************************************************************************/

void solve()
{
   int n,k;
   cin>>n>>k;
   int arr[n];
   for(int i=0;i<n;i++)
   {
       cin>>arr[i];
       arr[i]+=k;
   }
   int count=0;
   for(int i=0;i<n;i++)
   {
       if(arr[i]<=5)
       count++;
   }
   int ans=count/3;
   cout<<ans<<endl;
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	FASTIO();
	int t;
	cin>>t;
	while(t--)
	solve();
	return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_map>
#include <deque>
#include <map>
using namespace std;

int main()
{
	int total, period;
	cin >> total >> period;
	int *arr = new int [total];
	for (int i = 0; i < total; i++)
	{
		cin >> arr[i];
	}

	sort(arr, arr +total);

	int x = 0 , i;
	for (i = 1; i <= total; i++)
	{
		if (i % 3 == 0)
			x++;
		if (arr[i -1] + period > 5)
			break;
	}

	cout << x;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_map>
#include <deque>
#include <map>
using namespace std;

int main()
{
	int total, period;
	cin >> total >> period;
	int *arr = new int [total];
	for (int i = 0; i < total; i++)
	{
		cin >> arr[i];
	}

	sort(arr, arr +total);

	int x = 0;
	for (int i = 1; i <= total; i++)
	{
		if (i % 3 == 0 )
			x++;
		if (arr[i-1] + period > 5)
			break;
	}

	cout << x;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_map>
#include <deque>
#include <map>
using namespace std;

int main()
{
	int total, period;
	cin >> total >> period;
	int *arr = new int [total];
	for (int i = 0; i < total; i++)
	{
		cin >> arr[i];
	}

	sort(arr, arr +total);

	int x = 0 , i;
	for (i = 1; i <= total; i++)
	{
		if (arr[i -1] + period > 5)
			break;
		if (i % 3 == 0)
			x++;
	}

	cout << x;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_map>
#include <deque>
#include <map>
using namespace std;

int main()
{
	int total, period;
	cin >> total >> period;
	int *arr = new int [total];
	for (int i = 0; i < total; i++)
	{
		cin >> arr[i];
	}

	sort(arr, arr +total);

	int x = 0 , i;
	for (i = 0; i < total; i++)
	{
		if (i % 3 == 0 && i != 0)
			x++;
		if (arr[i] + period > 5)
			break;
	}

	if (i % 3 == 0)
		x++;

	cout << x;

}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_map>
#include <deque>
#include <map>
using namespace std;

int main()
{
	int total, period;
	cin >> total >> period;
	int *arr = new int [total];
	for (int i = 0; i < total; i++)
	{
		cin >> arr[i];
	}

	sort(arr, arr +total);

	int x = 0 , i;
	for (i = 0; i < total; i++)
	{
		if (i % 3 == 0 && i != 0)
			x++;
		if (arr[i] + period > 5)
			break;
	}

	if (i == total)
		x++;

	cout << x;

}


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

int main()
{
    int n,k;
    cin>>n>>k;
    if(k>n)
    {
        cout<<"0";
        return 0;
    }
    int y[n],count=0;
    for(int i=0;i<n;i++)
    {
        cin>>y[i];
        if(y[i]<=5-k)
            count++;
    }
    for(int i=3;i<=n;i+=3)
    {
        if(count<i)
        {
            cout<<"0";
            return 0;
        }
        else if(count>=i)
         {
             cout<<count/3;
             return 0;
         }
    }

}


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

int main()
{
    int n,k;
    cin>>n>>k;
    if(n<3)
    {
        cout<<"0";
        return 0;
    }
    int y[n],count=0;
    for(int i=0;i<n;i++)
    {
        cin>>y[i];
        if(y[i]<=5-k)
            count++;
    }
    for(int i=3;i<=n;i+=3)
    {
        if(count<i)
        {
            cout<<"0";
            return 0;
        }
        else if(count>=i)
         {
             cout<<count/3;
             return 0;
         }
    }

}


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

int main()
{
    int n,k;
    cin>>n>>k;
    int y[n],count=0;
    for(int i=0;i<n;i++)
    {
        cin>>y[i];
        if(y[i]<=5-k)
            count++;
    }
    for(int i=3;i<=n;i+=3)
    {
        if(count<i)
        {
            cout<<"0";
            return 0;
        }
        else if(count==i)
         {
             cout<<count/3;
             return 0;
         }
    }

}


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

int main()
{
    int n,k;
    cin>>n>>k;
    int y[n],count=0;
    for(int i=0;i<n;i++)
    {
        cin>>y[i];
        if(y[i]<=5-k)
            count++;
    }
    for(int i=3;i<=n;i+=3)
    {
        if(count<i)
        {
            cout<<"0";
            return 0;
        }
        else if(count>=i)
         {
             cout<<count/3;
             return 0;
         }
    }

}


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

int main()
{
    int n,k,a,i,j,cnt=0,mark[2005],cnt1=0;
    vector<int>v;
    scanf("%d%d",&n,&k);

    for(i=0; i<n; i++)
    {
        cin>>a;
        v.push_back(a);
    }
    sort(v.begin(), v.end());
//    for(i=0; i<n; i++)
//    {
//        cout<<v[i]<<" ";
//    }
//    cout<<endl;
    if(n<3)
    {
        cout<<0<<endl;
        return 0;
    }
    else if(n<6)
    {
        n=3;
        for(i=0; i<n; i++)
        {
            cnt=0;
            while( v[i+2]<5)
            {
                v[i+2]=v[i+2]+1;
                cnt++;
            }
//            cout<<cnt<<endl;
            i=i+2;
            if(cnt>=k)
            {
                cnt1++;
            }
//            cout<<cnt1<<endl;
        }
//        cout<<cnt1<<endl;
    }
    else
    {
        for(i=0; i<n-2; i++)
        {
            cnt=0;
            while( v[i+2]<5)
            {
                v[i+2]=v[i+2]+1;
                cnt++;
            }
//       cout<<cnt<<endl;
            i=i+2;
            if(cnt>=k)
            {
                cnt1++;
            }
//       cout<<cnt1<<endl;
        }
        cout<<cnt1<<endl;
    }
    return 0;

}


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

int main()
{
   int n,k,a,i,j,cnt=0,mark[2005],cnt1=0;
   vector<int>v;
   scanf("%d%d",&n,&k);

   for(i=0; i<n; i++)
   {
       cin>>a;
       v.push_back(a);
   }
   sort(v.begin(), v.end());
//   for(i=0; i<n; i++)
//   {
//      cout<<v[i]<<" ";
//   }
//   cout<<endl;
    if(n<3)
   {
       cout<<0<<endl;
       return 0;
   }
   else if(n<6)
   {
       n=3;
   for(i=0; i<n; i++)
   {
       cnt=0;
       while( v[i+2]<5)
       {
           v[i+2]=v[i+2]+1;
           cnt++;
       }
//       cout<<cnt<<endl;
         i=i+2;
       if(cnt>=k)
       {
           cnt1++;
       }
//       cout<<cnt1<<endl;
    }
    cout<<cnt1<<endl;
   }
   else
   {
        for(i=0; i<n; i++)
   {
       cnt=0;
       while( v[i+2]<5)
       {
           v[i+2]=v[i+2]+1;
           cnt++;
       }
//       cout<<cnt<<endl;
         i=i+2;
       if(cnt>=k)
       {
           cnt1++;
       }
//       cout<<cnt1<<endl;
    }
    cout<<cnt1<<endl;
   }
return 0;

}


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

int main()
{
    int n,k,a,i,j,cnt=0,mark[2005],cnt1=0;
    vector<int>v;
    scanf("%d%d",&n,&k);

    for(i=0; i<n; i++)
    {
        cin>>a;
        v.push_back(a);
    }
    sort(v.begin(), v.end());
//    for(i=0; i<n; i++)
//    {
//        cout<<v[i]<<" ";
//    }
//    cout<<endl;
    if(n<3)
    {
        cout<<0<<endl;
        return 0;
    }
    else if(n<6)
    {
        n=3;
        for(i=0; i<n-2; i++)
        {
            cnt=0;
            while( v[i+2]<5)
            {
                v[i+2]=v[i+2]+1;
                cnt++;
            }
//          cout<<cnt<<endl;
            i=i+2;
            if(cnt>=k)
            {
                cnt1++;
            }
//          cout<<cnt1<<endl;
        }       cout<<cnt1<<endl;
    }
    else
    {
        for(i=0; i<n-2; i++)
        {
            cnt=0;
            while( v[i+2]<5)
            {
                v[i+2]=v[i+2]+1;
                cnt++;
            }
//  cout<<cnt<<endl;
            i=i+2;
            if(cnt>=k)
            {
                cnt1++;
            }
//       cout<<cnt1<<endl;
        }
        cout<<cnt1<<endl;
    }
    return 0;

}


#include <iostream>
using namespace std;
int main()
{
	int n, k, a[n], cnt = 0;
	cin>>n>>k;
	for(int i=0; i<n; i++)
	{
		cin>>a[i];
		if((5 - a[i]) >= k)
		{
			cnt++;
		}
	}

	cout<<cnt/3;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n, k, a[n], cnt = 0;
	cin>>n>>k;
	for(int i=0; i<n; i++)
	{
		cin>>a[i];
		if((5 - a[i]) >= k)
		{
			cnt++;
		}
	}

	cout<<cnt / 3;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n, k, arr[n], cnt = 0;
	cin>>n>>k;
	for(int i=0; i<n; i++)
	{
		cin>>arr[i];
		if((5 - arr[i]) >= k)
		{
			cnt++;
		}
	}

	cout<<cnt/3;
	return 0;
}


#include <iostream>
using namespace std;
int main()
{

	int n, k, cnt = 0;
	cin>>n>>k;
	int  a[n];
	for(int i=0; i<n; i++)
	{
		cin>>a[i];
		if((5 - a[i]) >= k)
		{
			cnt++;
		}
	}

	cout<<cnt / 3;
	return 0;
}


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

int k,n,count,kq;
int a[2005];

int main() {
    //freopen('test.txt',"r",stdin);
    cin >> n >> k;
    for (int i=1; i<=n, i++) {
        cin >> a[i];
        if (a[i]<k) {
            count=count+1;
        }
    }
    kq=count/k;
    cout << kq;
}


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

int k,n,kq;
int a[2005];

int main() {
  //  freopen("test.txt","r",stdin);
    cin >> n >> k;
    for (int i=1; i<=n; i++) {
        cin >> a[i];
      if ( 5 - a[i] >= k ) {
            kq= kq+1;
    }
    }
    kq=kq/3;
    cout << kq;
}


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

int k,n,kq;
int a[2005];

int main() {
  //  freopen("test.txt","r",stdin);
    cin >> n >> k;
    for (int i=1; i<=n; i++) {
        cin >> a[i];
      if ( 5 - a[i] <= k ) {
            kq= kq+1;
        }
    }
    kq=kq/3;
    cout << kq;
}


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

int k,n,kq;
int a[2005];

int main() {
   // freopen("test.txt","r",stdin);
    cin >> n >> k;
    for (int i=1; i<=n; i++) {
        cin >> a[i];
      if ( 5 - a[i] >= k ) {
            kq= kq+1;
    }
    }
    kq=kq/3;
    cout << kq;
}


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

int k,n,kq;
int a[2005];

int main() {
   // freopen("test.txt","r",stdin);
    cin >> n >> k;
    for (int i=1; i<=n; i++) {
        cin >> a[i];
      if ( 5 - a[i] <= k ) {
            kq= kq+1;
        }
    }
    kq=kq/3;
    cout << kq;
}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
   // ios_base::sync_with_stdio(false);
    //cin.tie(NULL);

	long k,n,x=0,t[n];
	//memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){
        cin>>t[i];
        if(5-t[i]>=k)++x;
     }
	 cout<<x/3<<endl;
	 //<<x;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	ll k,n,x=0,t[n];
	cin>>n>>k;
	 for(int i=0;i<n;i++){cin>>t[i];if(5-t[i]>=k)x++;}
	 cout<<x/3<<endl;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
   // ios_base::sync_with_stdio(false);
    //cin.tie(NULL);

	long k,n,x=0,t[n];
	memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){
        cin>>t[i];
        if(t[i]>=5-k)++x;
     }
	 cout<<x/3<<endl;
	 //<<x;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
   // ios_base::sync_with_stdio(false);
    //cin.tie(NULL);

	long k,n,x=0,t;
	//memset(t,0,n);
	cin>>n>>k;
	t=5-k;
	 for(int i=0;i<n;i++){
        cin>>q;
        if(q<=t)++x;
     }
	 cout<<x/3<<endl;
	 //<<x;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	int  k,n,x=0;
	int t[n];
	memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){cin>>t[i];if(5-t[i]>=k)x++;}
	 cout<<x/3<<endl;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	int k,n,x=0,t[n];
	cin>>n>>k;
	 for(int i=0;i<n;i++){cin>>t[i];if(5-t[i]>=k)x++;}
	 cout<<x/3<<endl;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	int k,n,x=0,t[n];
	memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){cin>>t[i];if(t[i]+k=<5)x++;}
	 cout<<x/3<<endl;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	long k,n,x=0,t[n];
	//memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){
        cin>>t[i];
        if(5-t[i]>=k)++x;
     }
	 cout<<x/3<<endl//<<x;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
   // ios_base::sync_with_stdio(false);
    //cin.tie(NULL);

	long k,n,x=0,q,t;
	//memset(t,0,n);
	cin>>n>>k;
	t=5-k;
	 for(int i=0;i<n;i++){
        cin>>q;
        if(q<=t)++x;
     }
	 cout<<x/3<<endl;
	 //<<x;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	long k,n,x=0,t[n];
	//memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){
            cin>>t[i];if(t[i]+k<=5)x++;
     }
	 cout<<x/3<<endl;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
   // ios_base::sync_with_stdio(false);
    //cin.tie(NULL);

	long k,n,x=0,t;
	memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){
        cin>>t[i];
        if(t[i]>=5-k)++x;
     }
	 cout<<x/3<<endl;
	 //<<x;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
   // cin.tie(NULL);

	long k,n,x=0,t ;
	//memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){
        cin>>t;
        if(5-t >=k)x++;
     }
	 cout<<x/3<<endl;
	 //<<x;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	long k,n,x=0,t[n];
	//memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){
        cin>>t[i];
        if(5-t[i]>=k)++x;
     }
	 cout<<x/3<<endl;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	int k,n,x=0,t[n];
	memset(t,0,n);
	cin>>n>>k;
	 for(int i=0;i<n;i++){cin>>t[i];if(t[i]+k<=5)x++;}
	 cout<<x/3<<endl;
	return 0;

}


#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

	ll k=0,n=0,x=0,t[n];
	cin>>n>>k;
	 for(int i=0;i<n;i++){cin>>t[i];if(5-t[i]>=k)x++;}
	 cout<<x/3<<endl;
	return 0;

}


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

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

	int n, k;
	cin >> n >> k;

	int arr[n];
	for(int i=0; i<n; i++){
		cin >> arr[i];
		arr[i] = 5-arr[i];
	}
	sort(arr,arr+n);
	int out;

	for(int i=n-1; i>=0; i--){
		if(arr[i]-k <= 0){
			out = i+1;
			break;
		}
	}

	cout << (n-out)/3 << endl;

	// your code goes here
	return 0;
}


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

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

	int n, k;
	cin >> n >> k;

	int arr[n];
	for(int i=0; i<n; i++){
		cin >> arr[i];
		arr[i] = 5-arr[i];
	}
	sort(arr,arr+n);
	int out;

	for(int i=n-1; i>=0; i--){
		if(arr[i]-k < 0){
			out = i+1;
			break;
		}
	}

	cout << (5-out)/3 << endl;

	// your code goes here
	return 0;
}


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

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

	int n, k;
	cin >> n >> k;

	int arr[n];
	for(int i=0; i<n; i++){
		cin >> arr[i];
		arr[i] = 5-arr[i];
	}
	sort(arr,arr+n);
	int out=0;

	for(int i=n-1; i>=0; i--){
		if(arr[i]-k < 0){
			out = i+1;
			break;
		}
	}

	cout << (n-out)/3 << endl;

	// your code goes here
	return 0;
}


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

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

	int n, k;
	cin >> n >> k;

	int arr[n];
	for(int i=0; i<n; i++){
		cin >> arr[i];
		arr[i] = 5-arr[i];
	}
	sort(arr,arr+n);
	int out=0;

	for(int i=n-1; i>=0; i--){
		if(arr[i]-k <= 0){
			out = i+1;
			break;
		}
	}

	cout << (n-out)/3 << endl;

	// your code goes here
	return 0;
}


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

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

	int n, k;
	cin >> n >> k;

	int arr[n];
	for(int i=0; i<n; i++){
		cin >> arr[i];
		arr[i] = 5-arr[i];
	}
	sort(arr,arr+n);
	int out;

	for(int i=n-1; i>=0; i--){
		if(arr[i]-k < 0){
			out = i+1;
			break;
		}
	}

	cout << (n-out)/3 << endl;

	// your code goes here
	return 0;
}


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

typedef long long int ll;
vector<ll>pp;
bool prime[90000000];
void seive(){

    ll maxx=90000000;

    for(int i=0;i<=maxx;i++){
        prime[i]=1;
    }

    prime[0]=0;
    prime[1]=0;
    for(ll i=2;i*i<=maxx;i++){
        if(prime[i]==1){
            for(ll j=i*i;j<=maxx;j+=i){
                prime[j]=0;
            }
        }
    }

    for(ll i=2;i<=maxx;i++){
        if(prime[i]){
            pp.push_back(i);
        }
    }
}
void primefact(int n){
   for(int i=2;i*i<=n;i++){
    if(n%i==0){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        cout<<i<<"^"<<cnt<<endl;
    }
    if(n>1) cout<<n<<"^"<<1<<endl;
   }
}

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

    ll  m,n,t,ab,k,a,b,c,d,flag=0;

    string s1,s2,s;
    vector<ll>vec;
    set<ll>st;
    char ch;
    vector<ll>vec1;
    map<ll,ll>mp1;
    map<char,ll>mp2;
    ll  sum=0;
    string str;
    cin>>t;
    while(t--){
       cin>>n;
       ll arr[n+5];
       for(int i=0;i<n;i++){
        cin>>arr[i];
        mp1[arr[i]]++;
       }
        ll cnt=0;
            ll maxx=0;
       if(mp1[1]==n && mp1[1]%2==1){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==n && mp1[1]%2==0){
        cout<<"Second"<<endl;
       }
       else if(mp1[1]==0){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==1 && arr[0]==1){
        cout<<"Second"<<endl;
       }
      else{

        for(int i=0;i<n;i++){
            if(arr[i]==1 && i==n-1){
                    cnt++;
                maxx=cnt;
            }
            else if(arr[i]==1){
                cnt++;
            }
            else{
                    if(cnt!=0){
                       maxx=cnt;
                       cnt=0;
                    }

            }
        }
         cout<<maxx<<endl;
        if(maxx%2==1) cout<<"First"<<endl;
        else cout<<"Second"<<endl;
      }
      mp1.clear();
    }
}


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

typedef long long int ll;
vector<ll>pp;
bool prime[90000000];
void seive(){

    ll maxx=90000000;

    for(int i=0;i<=maxx;i++){
        prime[i]=1;
    }

    prime[0]=0;
    prime[1]=0;
    for(ll i=2;i*i<=maxx;i++){
        if(prime[i]==1){
            for(ll j=i*i;j<=maxx;j+=i){
                prime[j]=0;
            }
        }
    }

    for(ll i=2;i<=maxx;i++){
        if(prime[i]){
            pp.push_back(i);
        }
    }
}
void primefact(int n){
   for(int i=2;i*i<=n;i++){
    if(n%i==0){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        cout<<i<<"^"<<cnt<<endl;
    }
    if(n>1) cout<<n<<"^"<<1<<endl;
   }
}

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

    ll  m,n,t,ab,k,a,b,c,d,flag=0;

    string s1,s2,s;
    vector<ll>vec;
    set<ll>st;
    char ch;
    vector<ll>vec1;
    map<ll,ll>mp1;
    map<char,ll>mp2;
    ll  sum=0;
    string str;
    cin>>t;
    while(t--){
       cin>>n;
       ll arr[n+5];
       for(int i=0;i<n;i++){
        cin>>arr[i];
        mp1[arr[i]]++;
       }
        ll cnt=0;
            ll maxx=0;
       if(mp1[1]==n && mp1[1]%2==1){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==n && mp1[1]%2==0){
        cout<<"Second"<<endl;
       }
       else if(mp1[1]==0){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==1 && arr[0]==1){
        cout<<"Second"<<endl;
       }
      else{

        for(int i=0;i<n;i++){
            if(arr[i]==1 && i==n-1){
                    cnt++;
                maxx=cnt;
            }
            else if(arr[i]==1){
                cnt++;
            }
            else{
                    if(cnt!=0){
                       maxx=cnt;
                       cnt=0;
                    }

            }
        }
         //cout<<maxx<<endl;
        if(maxx%2==1) cout<<"First"<<endl;
        else cout<<"Second"<<endl;
      }
      mp1.clear();
    }
}


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

typedef long long int ll;
vector<ll>pp;
bool prime[90000000];
void seive(){

    ll maxx=90000000;

    for(int i=0;i<=maxx;i++){
        prime[i]=1;
    }

    prime[0]=0;
    prime[1]=0;
    for(ll i=2;i*i<=maxx;i++){
        if(prime[i]==1){
            for(ll j=i*i;j<=maxx;j+=i){
                prime[j]=0;
            }
        }
    }

    for(ll i=2;i<=maxx;i++){
        if(prime[i]){
            pp.push_back(i);
        }
    }
}
void primefact(int n){
   for(int i=2;i*i<=n;i++){
    if(n%i==0){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        cout<<i<<"^"<<cnt<<endl;
    }
    if(n>1) cout<<n<<"^"<<1<<endl;
   }
}

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

    ll  m,n,t,ab,k,a,b,c,d,flag=0;

    string s1,s2,s;
    vector<ll>vec;
    set<ll>st;
    char ch;
    vector<ll>vec1;
    map<ll,ll>mp1;
    map<char,ll>mp2;
    ll  sum=0;
    string str;
    cin>>t;
    while(t--){
       cin>>n;
       ll arr[n+5];
       for(int i=0;i<n;i++){
        cin>>arr[i];
        mp1[arr[i]]++;
       }

       if(mp1[1]==n && mp1[1]%2==1){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==n && mp1[1]%2==0){
        cout<<"Second"<<endl;
       }
       else if(mp1[1]==0){
        cout<<"First"<<endl;
       }
       else if(mp1[1]!=n && mp1[1]%2==1){
        cout<<"Second"<<endl;
       }
       else if(mp1[1]!=n && mp1[1]%2==0){
        cout<<"First"<<endl;
       }

    }
}


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

typedef long long int ll;
vector<ll>pp;
bool prime[90000000];
void seive(){

    ll maxx=90000000;

    for(int i=0;i<=maxx;i++){
        prime[i]=1;
    }

    prime[0]=0;
    prime[1]=0;
    for(ll i=2;i*i<=maxx;i++){
        if(prime[i]==1){
            for(ll j=i*i;j<=maxx;j+=i){
                prime[j]=0;
            }
        }
    }

    for(ll i=2;i<=maxx;i++){
        if(prime[i]){
            pp.push_back(i);
        }
    }
}
void primefact(int n){
   for(int i=2;i*i<=n;i++){
    if(n%i==0){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        cout<<i<<"^"<<cnt<<endl;
    }
    if(n>1) cout<<n<<"^"<<1<<endl;
   }
}

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

    ll  m,n,t,ab,k,a,b,c,d,flag=0;

    string s1,s2,s;
    vector<ll>vec;
    set<ll>st;
    char ch;
    vector<ll>vec1;
    map<ll,ll>mp1;
    map<char,ll>mp2;
    ll  sum=0;
    string str;
    cin>>t;
    while(t--){
       cin>>n;
       ll arr[n+5];
       for(int i=0;i<n;i++){
        cin>>arr[i];
        mp1[arr[i]]++;
       }

       if(mp1[1]==n && mp1[1]%2==1){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==n && mp1[1]%2==0){
        cout<<"Second"<<endl;
       }
       else if(mp1[1]==0){
        cout<<"First"<<endl;
       }
       else if(mp1[1]!=n && mp1[1]%2==1){
        cout<<"Second"<<endl;
       }
       else if(mp1[1]!=n && mp1[1]%2==0){
        cout<<"First"<<endl;
       }
      mp1.clear();
    }
}


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

typedef long long int ll;
vector<ll>pp;
bool prime[90000000];
void seive(){

    ll maxx=90000000;

    for(int i=0;i<=maxx;i++){
        prime[i]=1;
    }

    prime[0]=0;
    prime[1]=0;
    for(ll i=2;i*i<=maxx;i++){
        if(prime[i]==1){
            for(ll j=i*i;j<=maxx;j+=i){
                prime[j]=0;
            }
        }
    }

    for(ll i=2;i<=maxx;i++){
        if(prime[i]){
            pp.push_back(i);
        }
    }
}
void primefact(int n){
   for(int i=2;i*i<=n;i++){
    if(n%i==0){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        cout<<i<<"^"<<cnt<<endl;
    }
    if(n>1) cout<<n<<"^"<<1<<endl;
   }
}

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

    ll  m,n,t,ab,k,a,b,c,d,flag=0;

    string s1,s2,s;
    vector<ll>vec;
    set<ll>st;
    char ch;
    vector<ll>vec1;
    map<ll,ll>mp1;
    map<char,ll>mp2;
    ll  sum=0;
    string str;
    cin>>t;
    while(t--){
       cin>>n;
       ll arr[n+5];
       for(int i=0;i<n;i++){
        cin>>arr[i];
        mp1[arr[i]]++;
       }
        ll cnt=0;
            ll maxx=0;
       if(mp1[1]==n && mp1[1]%2==1){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==n && mp1[1]%2==0){
        cout<<"Second"<<endl;
       }
       else if(mp1[1]==0){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==1 && arr[0]==1){
        cout<<"Second"<<endl;
       }
      else if(arr[0]!=1){
        cout<<"First"<<endl;
      }
      else if(mp1[1]>=1 && arr[0]==1){
        for(int i=0;i<n;i++){
            if(arr[i]==1 && i==n-1){
                cnt++;
                maxx=cnt;
            }
            else if(arr[i]==1){
                cnt++;
            }
            else {
                maxx=cnt;
                break;
            }
        }
        if(maxx%2==1){
            cout<<"Second"<<endl;
        }
        else cout<<"First"<<endl;
        maxx=0;
        cnt==0;
      }
      mp1.clear();
    }
}


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

typedef long long int ll;
vector<ll>pp;
bool prime[90000000];
void seive(){

    ll maxx=90000000;

    for(int i=0;i<=maxx;i++){
        prime[i]=1;
    }

    prime[0]=0;
    prime[1]=0;
    for(ll i=2;i*i<=maxx;i++){
        if(prime[i]==1){
            for(ll j=i*i;j<=maxx;j+=i){
                prime[j]=0;
            }
        }
    }

    for(ll i=2;i<=maxx;i++){
        if(prime[i]){
            pp.push_back(i);
        }
    }
}
void primefact(int n){
   for(int i=2;i*i<=n;i++){
    if(n%i==0){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        cout<<i<<"^"<<cnt<<endl;
    }
    if(n>1) cout<<n<<"^"<<1<<endl;
   }
}

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

    ll  m,n,t,ab,k,a,b,c,d,flag=0;

    string s1,s2,s;
    vector<ll>vec;
    set<ll>st;
    char ch;
    vector<ll>vec1;
    map<ll,ll>mp1;
    map<char,ll>mp2;
    ll  sum=0;
    string str;
    cin>>t;
    while(t--){
       cin>>n;
       ll arr[n+5];
       for(int i=0;i<n;i++){
        cin>>arr[i];
        mp1[arr[i]]++;
       }
        ll cnt=0;
            ll maxx=0;
       if(mp1[1]==n && mp1[1]%2==1){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==n && mp1[1]%2==0){
        cout<<"Second"<<endl;
       }
       else if(mp1[1]==0){
        cout<<"First"<<endl;
       }
       else if(mp1[1]==1 && arr[0]==1){
        cout<<"Second"<<endl;
       }
      else if(mp1[1]%2==1 && n%2==0){
          cout<<"First"<<endl;
      }
      else if(mp1[1]%2==1 && n%2==1){
        cout<<"Second"<<endl;
      }
      mp1.clear();
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  FAST   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define  vi     vector <int>
#define  vii    vector<pair<int,int>>
#define  unmap  unordered_map<int,int>
#define  maxpq  priority_queue<int>
#define  minpq  priority_queue<int, vector<int>, greater<int>>
#define  pf     push_front
#define  pb     push_back
#define  fi     first
#define  se     second
#define  maxall *max_element
#define  minall *min_element
#define  el     "\n"
#define  all(v) v.begin(),v.end()
#define  ull    unsigned long long
#define  int    long long
#define  ll     long long
#define  inf    LLONG_MAX
#define  PI     acos(-1)
const int mod = 1e9 + 7;
int i, j;
int modDiff(int a, int b)  {return ((a - b) % mod + mod) % mod;}
int ceilVal(int a, int b)  {return (a / b + (a % b != 0));}
int ctoi(char a)  {return (a - '0');}
void oj() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int power(int x, int y, int p) {
	int res = 1;
	x %= p;
	while (y) {
		if (y & 1)
			res = (res * x) % p;
		x = (x * x) % p;
		y = (y >> 1);
	}
	return res;
}

int prod(int x, int y) {
	int res = 0;
	x %= mod;
	while (y) {
		if (y & 1)
			res = (res + x) % mod;
		x = (x * 2) % mod;
		y = y >> 1;
	}
	return res;
}
/****************|A + B == (A ^ B) + 2 * (A & B)|*****************/

int32_t main() {
	FAST;
	oj();
	int T = 1;
	cin >> T;
	while (T--) {
		int n;
		cin >> n;
		vi a(n);
		int cnt = 0;
		for (int i = 0; i < n; ++i) {
			cin >> a[i];
			if (a[i] == 1)
				cnt++;
		}
		if (cnt == n) {
			if (n % 2 == 0)
				cout << "Second" << el;
			else
				cout << "First" << el;
			continue;
		}
		int i = 0, ans = 0;
		for (i = 0; i < n; i++) {
			int co = 0;
			if (a[i] == 1) {
				co++;
			}
			else {
				if (co > 1)
					ans += co;
				co = 0;
			}
		}
		if (n > 1 && a[0] == 1 && a[1] != 1)
			ans--;
		if (ans % 2 == 0)
			cout << "First" << el;
		else
			cout << "Second" << el;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  FAST   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define  vi     vector <int>
#define  vii    vector<pair<int,int>>
#define  unmap  unordered_map<int,int>
#define  maxpq  priority_queue<int>
#define  minpq  priority_queue<int, vector<int>, greater<int>>
#define  pf     push_front
#define  pb     push_back
#define  fi     first
#define  se     second
#define  maxall *max_element
#define  minall *min_element
#define  el     "\n"
#define  all(v) v.begin(),v.end()
#define  ull    unsigned long long
#define  int    long long
#define  ll     long long
#define  inf    LLONG_MAX
#define  PI     acos(-1)
const int mod = 1e9 + 7;
int i, j;
int modDiff(int a, int b)  {return ((a - b) % mod + mod) % mod;}
int ceilVal(int a, int b)  {return (a / b + (a % b != 0));}
int ctoi(char a)  {return (a - '0');}
void oj() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int power(int x, int y, int p) {
	int res = 1;
	x %= p;
	while (y) {
		if (y & 1)
			res = (res * x) % p;
		x = (x * x) % p;
		y = (y >> 1);
	}
	return res;
}

int prod(int x, int y) {
	int res = 0;
	x %= mod;
	while (y) {
		if (y & 1)
			res = (res + x) % mod;
		x = (x * 2) % mod;
		y = y >> 1;
	}
	return res;
}
/****************|A + B == (A ^ B) + 2 * (A & B)|*****************/

int32_t main() {
	FAST;
	oj();
	int T = 1;
	cin >> T;
	while (T--) {
		int n;
		cin >> n;
		vi a(n);
		int cnt = 0;
		for (int i = 0; i < n; ++i) {
			cin >> a[i];
			if (a[i] == 1)
				cnt++;
		}
		if (cnt == n) {
			if (n % 2 == 0)
				cout << "Second" << el;
			else
				cout << "First" << el;
			continue;
		}
		if (cnt % 2 == 0)
			cout << "First" << el;
		else
			cout << "Second" << el;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  FAST   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define  vi     vector <int>
#define  vii    vector<pair<int,int>>
#define  unmap  unordered_map<int,int>
#define  maxpq  priority_queue<int>
#define  minpq  priority_queue<int, vector<int>, greater<int>>
#define  pf     push_front
#define  pb     push_back
#define  fi     first
#define  se     second
#define  maxall *max_element
#define  minall *min_element
#define  el     "\n"
#define  all(v) v.begin(),v.end()
#define  ull    unsigned long long
#define  int    long long
#define  ll     long long
#define  inf    LLONG_MAX
#define  PI     acos(-1)
const int mod = 1e9 + 7;
int i, j;
int modDiff(int a, int b)  {return ((a - b) % mod + mod) % mod;}
int ceilVal(int a, int b)  {return (a / b + (a % b != 0));}
int ctoi(char a)  {return (a - '0');}
void oj() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int power(int x, int y, int p) {
	int res = 1;
	x %= p;
	while (y) {
		if (y & 1)
			res = (res * x) % p;
		x = (x * x) % p;
		y = (y >> 1);
	}
	return res;
}

int prod(int x, int y) {
	int res = 0;
	x %= mod;
	while (y) {
		if (y & 1)
			res = (res + x) % mod;
		x = (x * 2) % mod;
		y = y >> 1;
	}
	return res;
}
/****************|A + B == (A ^ B) + 2 * (A & B)|*****************/

int32_t main() {
	FAST;
	oj();
	int T = 1;
	cin >> T;
	while (T--) {
		int n;
		cin >> n;
		vi a(n);
		int cnt = 0;
		for (int i = 0; i < n; ++i) {
			cin >> a[i];
			if (a[i] == 1)
				cnt++;
		}
		if (n == 1) {
			cout << "First" << el;
			continue;
		}
		if (cnt == n) {
			if (n % 2 == 0)
				cout << "Second" << el;
			else
				cout << "First" << el;
			continue;
		}
		int i = 0, ans = 0;
		while (a[i] == 1) {
			ans++;
			i++;
		}
		if (ans % 2 == 0)
			cout << "First" << el;
		else
			cout << "Second" << el;
		/*int i = 0, ans = 0, co = 0;
		for (i = 0; i < n; i++) {
			if (a[i] == 1) {
				co++;
			}
			else {
				if (co > 1)
					ans += co;
				co = 0;
			}
		}
		if (n > 1 && a[0] == 1 && a[1] != 1)
			ans--;
		if (ans % 2 == 0)
			cout << "First" << el;
		else
			cout << "Second" << el;*/
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  FAST   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define  vi     vector <int>
#define  vii    vector<pair<int,int>>
#define  unmap  unordered_map<int,int>
#define  maxpq  priority_queue<int>
#define  minpq  priority_queue<int, vector<int>, greater<int>>
#define  pf     push_front
#define  pb     push_back
#define  fi     first
#define  se     second
#define  maxall *max_element
#define  minall *min_element
#define  el     "\n"
#define  all(v) v.begin(),v.end()
#define  ull    unsigned long long
#define  int    long long
#define  ll     long long
#define  inf    LLONG_MAX
#define  PI     acos(-1)
const int mod = 1e9 + 7;
int i, j;
int modDiff(int a, int b)  {return ((a - b) % mod + mod) % mod;}
int ceilVal(int a, int b)  {return (a / b + (a % b != 0));}
int ctoi(char a)  {return (a - '0');}
void oj() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int power(int x, int y, int p) {
	int res = 1;
	x %= p;
	while (y) {
		if (y & 1)
			res = (res * x) % p;
		x = (x * x) % p;
		y = (y >> 1);
	}
	return res;
}

int prod(int x, int y) {
	int res = 0;
	x %= mod;
	while (y) {
		if (y & 1)
			res = (res + x) % mod;
		x = (x * 2) % mod;
		y = y >> 1;
	}
	return res;
}
/****************|A + B == (A ^ B) + 2 * (A & B)|*****************/

int32_t main() {
	FAST;
	oj();
	int T = 1;
	cin >> T;
	while (T--) {
		int n;
		cin >> n;
		vi a(n);
		int cnt = 0;
		for (int i = 0; i < n; ++i) {
			cin >> a[i];
			if (a[i] == 1)
				cnt++;
		}
		if (cnt == n) {
			if (n % 2 == 0)
				cout << "Second" << el;
			else
				cout << "First" << el;
			continue;
		}
		if (cnt == 0) {
			cout << "First" << el;
			continue;
		}
		int i = 0, ans = 0;
		for (i = 0; i < n; i++) {
			int co = 0;
			if (a[i] == 1) {
				co++;
			}
			else {
				if (co > 1)
					ans += co;
				co = 0;
			}
		}
		if (n > 1 && a[0] == 1 && a[1] != 1)
			ans--;
		if (ans % 2 == 0)
			cout << "First" << el;
		else
			cout << "Second" << el;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  FAST   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define  vi     vector <int>
#define  vii    vector<pair<int,int>>
#define  unmap  unordered_map<int,int>
#define  maxpq  priority_queue<int>
#define  minpq  priority_queue<int, vector<int>, greater<int>>
#define  pf     push_front
#define  pb     push_back
#define  fi     first
#define  se     second
#define  maxall *max_element
#define  minall *min_element
#define  el     "\n"
#define  all(v) v.begin(),v.end()
#define  ull    unsigned long long
#define  int    long long
#define  ll     long long
#define  inf    LLONG_MAX
#define  PI     acos(-1)
const int mod = 1e9 + 7;
int i, j;
int modDiff(int a, int b)  {return ((a - b) % mod + mod) % mod;}
int ceilVal(int a, int b)  {return (a / b + (a % b != 0));}
int ctoi(char a)  {return (a - '0');}
void oj() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int power(int x, int y, int p) {
	int res = 1;
	x %= p;
	while (y) {
		if (y & 1)
			res = (res * x) % p;
		x = (x * x) % p;
		y = (y >> 1);
	}
	return res;
}

int prod(int x, int y) {
	int res = 0;
	x %= mod;
	while (y) {
		if (y & 1)
			res = (res + x) % mod;
		x = (x * 2) % mod;
		y = y >> 1;
	}
	return res;
}
/****************|A + B == (A ^ B) + 2 * (A & B)|*****************/

int32_t main() {
	FAST;
	oj();
	int T = 1;
	cin >> T;
	while (T--) {
		int n;
		cin >> n;
		vi a(n);
		int cnt = 0;
		for (int i = 0; i < n; ++i) {
			cin >> a[i];
			if (a[i] == 1)
				cnt++;
		}
		if (cnt == n) {
			if (n % 2 == 0)
				cout << "Second" << el;
			else
				cout << "First" << el;
			continue;
		}
		int i = 0, ans = 0, co = 0;
		for (i = 0; i < n; i++) {
			if (a[i] == 1) {
				co++;
			}
			else {
				if (co > 1)
					ans += co;
				co = 0;
			}
		}
		if (n > 1 && a[0] == 1 && a[1] != 1)
			ans--;
		if (ans % 2 == 0)
			cout << "First" << el;
		else
			cout << "Second" << el;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  FAST   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define  vi     vector <int>
#define  vii    vector<pair<int,int>>
#define  unmap  unordered_map<int,int>
#define  maxpq  priority_queue<int>
#define  minpq  priority_queue<int, vector<int>, greater<int>>
#define  pf     push_front
#define  pb     push_back
#define  fi     first
#define  se     second
#define  maxall *max_element
#define  minall *min_element
#define  el     "\n"
#define  all(v) v.begin(),v.end()
#define  ull    unsigned long long
#define  int    long long
#define  ll     long long
#define  inf    LLONG_MAX
#define  PI     acos(-1)
const int mod = 1e9 + 7;
int i, j;
int modDiff(int a, int b)  {return ((a - b) % mod + mod) % mod;}
int ceilVal(int a, int b)  {return (a / b + (a % b != 0));}
int ctoi(char a)  {return (a - '0');}
void oj() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int power(int x, int y, int p) {
	int res = 1;
	x %= p;
	while (y) {
		if (y & 1)
			res = (res * x) % p;
		x = (x * x) % p;
		y = (y >> 1);
	}
	return res;
}

int prod(int x, int y) {
	int res = 0;
	x %= mod;
	while (y) {
		if (y & 1)
			res = (res + x) % mod;
		x = (x * 2) % mod;
		y = y >> 1;
	}
	return res;
}
/****************|A + B == (A ^ B) + 2 * (A & B)|*****************/

int32_t main() {
	FAST;
	oj();
	int T = 1;
	cin >> T;
	while (T--) {
		int n;
		cin >> n;
		vi a(n);
		int cnt = 0;
		for (int i = 0; i < n; ++i) {
			cin >> a[i];
			if (a[i] == 1)
				cnt++;
		}
		int i = 0, ans = 0;
		for (i = 0; i < n; i++) {
			int co = 0;
			if (a[i] == 1) {
				co++;
			}
			else {
				if (co > 1)
					ans += co;
				co = 0;
			}
		}
		if (n > 1 && a[0] == 1 && a[1] != 1)
			ans--;
		if (ans % 2 == 0)
			cout << "First" << el;
		else
			cout << "Second" << el;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  FAST   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define  vi     vector <int>
#define  vii    vector<pair<int,int>>
#define  unmap  unordered_map<int,int>
#define  maxpq  priority_queue<int>
#define  minpq  priority_queue<int, vector<int>, greater<int>>
#define  pf     push_front
#define  pb     push_back
#define  fi     first
#define  se     second
#define  maxall *max_element
#define  minall *min_element
#define  el     "\n"
#define  all(v) v.begin(),v.end()
#define  ull    unsigned long long
#define  int    long long
#define  ll     long long
#define  inf    LLONG_MAX
#define  PI     acos(-1)
const int mod = 1e9 + 7;
int i, j;
int modDiff(int a, int b)  {return ((a - b) % mod + mod) % mod;}
int ceilVal(int a, int b)  {return (a / b + (a % b != 0));}
int ctoi(char a)  {return (a - '0');}
void oj() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
int power(int x, int y, int p) {
	int res = 1;
	x %= p;
	while (y) {
		if (y & 1)
			res = (res * x) % p;
		x = (x * x) % p;
		y = (y >> 1);
	}
	return res;
}

int prod(int x, int y) {
	int res = 0;
	x %= mod;
	while (y) {
		if (y & 1)
			res = (res + x) % mod;
		x = (x * 2) % mod;
		y = y >> 1;
	}
	return res;
}
/****************|A + B == (A ^ B) + 2 * (A & B)|*****************/

int32_t main() {
	FAST;
	oj();
	int T = 1;
	cin >> T;
	while (T--) {
		int n;
		cin >> n;
		vi a(n);
		int cnt = 0;
		for (int i = 0; i < n; ++i) {
			cin >> a[i];
			if (a[i] == 1)
				cnt++;
		}
		if (n == 1) {
			cout << "First" << el;
			continue;
		}
		if (cnt == n) {
			if (n % 2 == 0)
				cout << "Second" << el;
			else
				cout << "First" << el;
			continue;
		}
		if (n > 1 && a[0] == 1 && a[1] != 1) {
			cout << "Second" << el;
		}
		else
			cout << "First" << el;
		/*int i = 0, ans = 0, co = 0;
		for (i = 0; i < n; i++) {
			if (a[i] == 1) {
				co++;
			}
			else {
				if (co > 1)
					ans += co;
				co = 0;
			}
		}
		if (n > 1 && a[0] == 1 && a[1] != 1)
			ans--;
		if (ans % 2 == 0)
			cout << "First" << el;
		else
			cout << "Second" << el;*/
	}
	return 0;
}


/**
*    author:  Mohamed Abo_Okail
*    created: 21/O7/2O2O
**/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define endl "\n"
#define ll long long
#define sz(x) int(x.size())

ll _gcd(ll x, ll y) {
	return (!y ? x : _gcd(y, x % y));
}
ll _lcm(ll x, ll y) {
	return (x / _gcd(x, y) * y);
}

int main() {
	std::ios_base::sync_with_stdio(0);
	int t; cin >> t;
	while(t--) {
		ll n; cin >> n;
		vector < ll > v(n);
		bool bol = 1;
		ll cnt = 0;
		for (int i = 0; i < n; i++) {
			cin >> v[i];
			if(v[i] == 1) cnt++;
		}
		if(!cnt || cnt == n) {
			cout << (n & 1 ? "First" : "Second") << endl;
			continue;
		}
		for (int i = 0; i < n - 1; i++) {
			if(v[i] == 1) bol = !bol;
			else {
				int flag = 0;
				for (int j = i + 1; j < n - 1; j++) {
					if(v[j] == 1) flag++;
					else break;
				}
				if(flag & 1) bol = !bol;
			}
		}
		cout << (bol ? "First" : "Second") << endl;
	}
}


/**
*    author:  Mohamed Abo_Okail
*    created: 21/O7/2O2O
**/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define endl "\n"
#define ll long long
#define sz(x) int(x.size())

ll _gcd(ll x, ll y) {
	return (!y ? x : _gcd(y, x % y));
}
ll _lcm(ll x, ll y) {
	return (x / _gcd(x, y) * y);
}

int main() {
	std::ios_base::sync_with_stdio(0);
	int t; cin >> t;
	while(t--) {
		ll n; cin >> n;
		vector < ll > v(n);
		ll cnt = 0, cur = 0, a = 0, b = 0;
		for (int i = 0; i < n; i++) {
			cin >> v[i];
			if(v[i] == 1) cnt++;
		}
		if(!cnt || cnt == n) {
			cout << (n & 1 ? "First" : "Second") << endl;
			continue;
		}
		for (int i = 0; i < n; i++) {
			if(v[i] == 1) cur++;
			else {
				if(cur & 1) a++;
				else if(!(cur & 1) && cur) b++;
				cur = 0;
			}
		}
		cout << ((a & 1) == (b & 1) ? "First" : "Second") << endl;
	}
}


/**
*    author:  Mohamed Abo_Okail
*    created: 21/O7/2O2O
**/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define endl "\n"
#define ll long long
#define sz(x) int(x.size())

ll _gcd(ll x, ll y) {
	return (!y ? x : _gcd(y, x % y));
}
ll _lcm(ll x, ll y) {
	return (x / _gcd(x, y) * y);
}

int main() {
	std::ios_base::sync_with_stdio(0);
	int t; cin >> t;
	while(t--) {
		ll n; cin >> n;
		vector < ll > v(n);
		ll cnt = 0, cur = 0, a = 0, b = 0;
		for (int i = 0; i < n; i++) {
			cin >> v[i];
			if(v[i] == 1) cnt++;
		}
		if(!cnt || cnt == n) {
			cout << (n & 1 ? "First" : "Second") << endl;
			continue;
		}
		for (int i = 0; i < n - 1; i++) {
			if(v[i] == 1) cur++;
			else {
				if(cur & 1) a++;
				else if(!(cur & 1) && cur) b++;
				cur = 0;
			}
		}
		cout << ((b >= a) ? "First" : "Second") << endl;
	}
}


/**
*    author:  Mohamed Abo_Okail
*    created: 21/O7/2O2O
**/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define endl "\n"
#define ll long long
#define sz(x) int(x.size())

ll _gcd(ll x, ll y) {
	return (!y ? x : _gcd(y, x % y));
}
ll _lcm(ll x, ll y) {
	return (x / _gcd(x, y) * y);
}

int main() {
	std::ios_base::sync_with_stdio(0);
	int t; cin >> t;
	while(t--) {
		ll n; cin >> n;
		vector < ll > v(n);
		bool bol = 1;
		ll cnt = 0;
		for (int i = 0; i < n; i++) {
			cin >> v[i];
			if(v[i] == 1) cnt++;
		}
		if(!cnt) {
			cout << "First" << endl;
			continue;
		}
		for (int i = 0; i < n - 1; i++) {
			if(v[i] == 1) bol = !bol;
			else {
				int flag = 0;
				for (int j = i + 1; j < n - 1; j++) {
					if(v[j] == 1) flag++;
					else break;
				}
				if(flag & 1) bol = !bol;
			}
		}
		cout << (bol ? "First" : "Second") << endl;
	}
}


/**
*    author:  Mohamed Abo_Okail
*    created: 21/O7/2O2O
**/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define endl "\n"
#define ll long long
#define sz(x) int(x.size())

ll _gcd(ll x, ll y) {
	return (!y ? x : _gcd(y, x % y));
}
ll _lcm(ll x, ll y) {
	return (x / _gcd(x, y) * y);
}

int main() {
	std::ios_base::sync_with_stdio(0);
	int t; cin >> t;
	while(t--) {
		ll n; cin >> n;
		vector < ll > v(n);
		bool bol = 1;
		ll cnt = 0;
		for (int i = 0; i < n; i++) {
			cin >> v[i];
			if(v[i] == 1) cnt++;
		}
		if(!cnt || cnt == n) {
			cout << (n & 1 ? "First" : "Second") << endl;
			continue;
		}
		for (int i = 0; i < n - 1; i++) {
			if(v[i] == 1) bol = !bol;
			else {
				if(v[i + 1] == 1) bol = !bol;
			}
		}
		cout << (bol ? "First" : "Second") << endl;
	}
}


/**
*    author:  Mohamed Abo_Okail
*    created: 21/O7/2O2O
**/
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#define endl "\n"
#define ll long long
#define sz(x) int(x.size())

ll _gcd(ll x, ll y) {
	return (!y ? x : _gcd(y, x % y));
}
ll _lcm(ll x, ll y) {
	return (x / _gcd(x, y) * y);
}

int main() {
	std::ios_base::sync_with_stdio(0);
	int t; cin >> t;
	while(t--) {
		ll n; cin >> n;
		vector < ll > v(n);
		ll cnt = 0, cur = 0;
		bool bol = 1;
		for (int i = 0; i < n; i++) {
			cin >> v[i];
			if(v[i] == 1) cnt++;
		}
		if(!cnt || cnt == n) {
			cout << (n & 1 ? "First" : "Second") << endl;
			continue;
		}
		for (int i = 0; i < n; i++) {
			if(v[i] == 1) cur++;
			else {
				if(cur & 1) bol = 0;
				break;
			}
		}
		cout << (bol ? "First" : "Second") << endl;
	}
}


#include<bits/stdc++.h>

#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair < int , int >
#define pll pair < ll , ll >
#define ff first
#define ss second

using namespace std;

int main() {
	ll n, t, i, j, s, p, k, m;
	vector < ll > v;
	ll a [ 10005 ];

	cin >> t;
//	t = 1; bagshaa codeforcesiin contest virtualdjiin

	while ( t --) {
		cin >> n;
		cin >> s;
		m = 1;
		for ( i = 1; i < n; i ++) {
			cin >> k;
			if ( i == n - 1 ) {
				if ( s == 1 ) {
					if ( m == 2 ) m = 1;
						else m = 2;
				}
			} else {
				if ( s == 1 ) {
					if ( m == 1 ) {
						m = 2;
					} else {
						m = 1;
					}
				} else {
					if ( k == 1 ) {
						if ( m == 1 ) m = 2;
							else m = 1;
					}
				}
				s = k;
			}
		}
		if ( m == 1 ) cout << "First\n";
			else cout << "Second\n";
	}

	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair < int , int >
#define pll pair < ll , ll >
#define ff first
#define ss second

using namespace std;

int main() {
	ll n, t, i, j, s, p, k, m;
	vector < ll > v;
	ll a [ 10005 ];

	cin >> t;
//	t = 1; bagshaa codeforcesiin contest virtualdjiin

	while ( t --) {
		ll n, x, i, cnt;

		cin >> n;

		for (i = 0; i < n; i ++) {
			cin >> a [ i ];
		}
//		sort ( a, a + n );
		cnt = 0;
		for ( i = 0; i < n; i ++) {
			if ( a [ i ] == 1) {
				cnt ++;
			} else {
				break;
			}
		}
		if ( cnt == n ) {
			if ( cnt % 2 == 0) {
				cout << "Second\n";
			} else {
				cout << "First\n" << endl;
			}
		} else {
			if ( cnt % 2 == 1 ) {
				cout << "Second\n";
			} else {
				cout << "First\n";
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair < int , int >
#define pll pair < ll , ll >
#define ff first
#define ss second

using namespace std;

int main() {
	ll n, t, i, j, s, p, k, m;
	vector < ll > v;
	ll a [ 10005 ];

	cin >> t;
//	t = 1; bagshaa codeforcesiin contest virtualdjiin

	while ( t --) {
		ll n, x, i, cnt;

		cin >> n;

		for (i = 0; i < n; i ++) {
			cin >> a [ i ];
		}
		sort ( a, a + n );
		cnt = 0;
		for ( i = 0; i < n; i ++) {
			if ( a [ i ] == 1) {
				cnt ++;
			} else {
				break;
			}
		}
		if ( cnt == n ) {
			if ( cnt % 2 == 0) {
				cout << "Second\n";
			} else {
				cout << "First\n" << endl;
			}
		} else {
			if ( cnt % 2 == 1 ) {
				cout << "Second\n";
			} else {
				cout << "First\n";
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair < int , int >
#define pll pair < ll , ll >
#define ff first
#define ss second

using namespace std;

int main() {
	ll n, t, i, j, s, p, k, m;
	vector < ll > v;
	ll a [ 10005 ];

	cin >> t;
//	t = 1; bagshaa codeforcesiin contest virtualdjiin

	while ( t --) {
		cin >> n;
		cin >> s;
		m = 1;
		for ( i = 1; i < n; i ++) {
			cin >> k;
			if ( s == 1 ) {
				if ( m == 1 ) {
					m = 2;
				} else {
					m = 1;
				}
			} else {
				if ( k == 1 ) {
					if ( i < n - 1 ) {
						if ( m == 1 ) m = 2;
							else m = 1;
					}
				}
			}
			s = k;
		}
		if ( m == 1 ) cout << "First\n";
			else cout << "Second\n";
	}

	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair < int , int >
#define pll pair < ll , ll >
#define ff first
#define ss second

using namespace std;

int main() {
	ll n, t, i, j, s, p, k, m;
	vector < ll > v;
	ll a [ 1000005 ];

	cin >> t;
//	t = 1; bagshaa codeforcesiin contest virtualdjiin

	while ( t --) {
		ll n, x, i, cnt;

		cin >> n;

		for (i = 0; i < n; i ++) {
			cin >> a [ i ];
		}
//		sort ( a, a + n );
		cnt = 0;
		for ( i = 0; i < n; i ++) {
			if ( a [ i ] == 1) {
				cnt ++;
			} else {
				i = n;
			}
		}
		if ( cnt == n ) {
			if ( cnt % 2 == 0) {
				cout << "Second\n";
			} else {
				cout << "First\n" << endl;
			}
		} else {
			if ( cnt % 2 == 1 ) {
				cout << "Second\n";
			} else {
				cout << "First\n";
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>

#define pb push_back
#define ll long long
#define mp make_pair
#define pii pair < int , int >
#define pll pair < ll , ll >
#define ff first
#define ss second

using namespace std;

int main() {
	ll n, t, i, j, s, p, k, m;
	vector < ll > v;
	ll a [ 10005 ];

	cin >> t;
//	t = 1; bagshaa codeforcesiin contest virtualdjiin

	while ( t --) {
		cin >> n;
		cin >> s;
		m = 1;
		for ( i = 1; i < n; i ++) {
			cin >> k;
			if ( s == 1 ) {
				if ( m == 1 ) {
					m = 2;
				} else {
					m = 1;
				}
			} else {
				if ( k == 1 ) {
					if ( m == 1 ) m = 2;
						else m = 1;
				}
			}
			s = k;
		}
		if ( m == 1 ) cout << "First\n";
			else cout << "Second\n";
	}

	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdbool.h>
#include <bits/stdc++.h>
using namespace std;
#define printarr(a,n) for(int mnmn=0;mnmn<n;mnmn++){printf("%d ",a[mnmn] );}printf("\n");
int cmpfunc(const void* a, const void* b ){return (*(int*)b)-(*(int*)a);}
void swap(int* a,int* b){int temp= *a;*a=*b;*b=temp;}
void bubbleSort(int* arr,int* b,int len) { for(int i=0;i<len-1;i++){ for(int j=0;j<len-i-1;j++){ if(arr[j]>arr[j+1]){ int temp= arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } }

int main()
{
    int t;
    scanf("%d\n",&t );
    while(t--){
        int n,arr[200002],flag=0,res=0;
        scanf("%d\n",&n );
        for(int i=0;i<n;i++){
            scanf("%d\n",&arr[i] );

        }
        // printarr(arr,n);
        for(int i=0;i<n;i++){
            if(!flag&&arr[i]>1){
                flag=i;
                break;
            }
        }
        if(flag==0){
            if(n%2){
                printf("First\n" );
            }
            else{
                printf("Second\n" );
            }
            continue;
        }
        if(flag%2){
            printf("Second\n");
        }
        else{
            printf("First\n");
        }

    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdbool.h>
#include <bits/stdc++.h>
using namespace std;
#define printarr(a,n) for(int mnmn=0;mnmn<n;mnmn++){printf("%d ",a[mnmn] );}printf("\n");
int cmpfunc(const void* a, const void* b ){return (*(int*)b)-(*(int*)a);}
void swap(int* a,int* b){int temp= *a;*a=*b;*b=temp;}
void bubbleSort(int* arr,int* b,int len) { for(int i=0;i<len-1;i++){ for(int j=0;j<len-i-1;j++){ if(arr[j]>arr[j+1]){ int temp= arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } }

int main()
{
    int t;
    scanf("%d\n",&t );
    while(t--){
        int n,arr[200002],flag=-1,res=0;
        scanf("%d\n",&n );
        for(int i=0;i<n;i++){
            scanf("%d\n",&arr[i] );

        }
        // printarr(arr,n);
        for(int i=0;i<n;i++){
            if(!flag&&arr[i]>1){
                flag=i;
                break;
            }
        }
        if(flag==-1){
            if(n%2){
                printf("First\n" );
            }
            else{
                printf("Second\n" );
            }
            continue;
        }
        if(flag%2){
            printf("Second\n");
        }
        else{
            printf("First\n");
        }

    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdbool.h>
#include <bits/stdc++.h>
using namespace std;
#define printarr(a,n) for(int mnmn=0;mnmn<n;mnmn++){printf("%d ",a[mnmn] );}printf("\n");
int cmpfunc(const void* a, const void* b ){return (*(int*)b)-(*(int*)a);}
void swap(int* a,int* b){int temp= *a;*a=*b;*b=temp;}
void bubbleSort(int* arr,int* b,int len) { for(int i=0;i<len-1;i++){ for(int j=0;j<len-i-1;j++){ if(arr[j]>arr[j+1]){ int temp= arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } }

int main()
{
    int t;
    scanf("%d\n",&t );
    while(t--){
        int n,arr[200002],flag=0,res=0;
        scanf("%d\n",&n );
        for(int i=0;i<n;i++){
            scanf("%d\n",&arr[i] );

        }
        // printarr(arr,n);
        for(int i=0;i<n;i++){
            if(!flag&&arr[i]>1){
                flag=i;
                break;
            }
        }
        if(flag==0){
            if(n%2){
                printf("First\n" );
            }
            else{
                printf("Second\n" );
            }
            continue;
        }
        if(flag%2){
            printf("First\n");
        }
        else{
            printf("Second\n");
        }

    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdbool.h>
#include <bits/stdc++.h>
using namespace std;
#define printarr(a,n) for(int mnmn=0;mnmn<n;mnmn++){printf("%d ",a[mnmn] );}printf("\n");
int cmpfunc(const void* a, const void* b ){return (*(int*)b)-(*(int*)a);}
void swap(int* a,int* b){int temp= *a;*a=*b;*b=temp;}
void bubbleSort(int* arr,int* b,int len) { for(int i=0;i<len-1;i++){ for(int j=0;j<len-i-1;j++){ if(arr[j]>arr[j+1]){ int temp= arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } }

int main()
{
    int t;
    scanf("%d\n",&t );
    while(t--){
        int n,arr[200002],flag=-1,res=0;
        scanf("%d\n",&n );
        for(int i=0;i<n;i++){
            scanf("%d\n",&arr[i] );

        }
        // printarr(arr,n);
        for(int i=0;i<n;i++){
            if(arr[i]>1){
                flag=i;
                break;
            }
        }
        if(flag==-1){
            if(n%2){
                printf("First\n" );
            }
            else{
                printf("Second\n" );
            }
            continue;
        }
        if(flag%2){
            printf("Second\n");
        }
        else{
            printf("First\n");
        }

    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdbool.h>
#include <bits/stdc++.h>
using namespace std;
#define printarr(a,n) for(int mnmn=0;mnmn<n;mnmn++){printf("%d ",a[mnmn] );}printf("\n");
int cmpfunc(const void* a, const void* b ){return (*(int*)b)-(*(int*)a);}
void swap(int* a,int* b){int temp= *a;*a=*b;*b=temp;}
void bubbleSort(int* arr,int* b,int len) { for(int i=0;i<len-1;i++){ for(int j=0;j<len-i-1;j++){ if(arr[j]>arr[j+1]){ int temp= arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } }

int main()
{
    int t;
    scanf("%d\n",&t );
    while(t--){
        int n,arr[200002],flag=0,res=0;
        scanf("%d\n",&n );
        for(int i=0;i<n;i++){
            scanf("%d\n",&arr[i] );
        }
        for(int i=0;i<n-1;i++){
            if(arr[i]==1){
                flag ^=1;
            }
            else if(arr[i+1]==1){
                i++;
            }
        }
        if(flag){
            printf("Second\n");
        }
        else{
            printf("First\n");
        }

    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdbool.h>
#include <bits/stdc++.h>
using namespace std;
#define printarr(a,n) for(int mnmn=0;mnmn<n;mnmn++){printf("%d ",a[mnmn] );}printf("\n");
int cmpfunc(const void* a, const void* b ){return (*(int*)b)-(*(int*)a);}
void swap(int* a,int* b){int temp= *a;*a=*b;*b=temp;}
void bubbleSort(int* arr,int* b,int len) { for(int i=0;i<len-1;i++){ for(int j=0;j<len-i-1;j++){ if(arr[j]>arr[j+1]){ int temp= arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } }

int main()
{
    int t;
    scanf("%d\n",&t );
    while(t--){
        int n,arr[200002],flag=0,res=0;
        scanf("%d\n",&n );
        for(int i=0;i<n;i++){
            scanf("%d\n",&arr[i] );
        }
        // printarr(arr,n);
        for(int i=0;i<n-1;i++){
            if(arr[i]==1){
                arr[i]=0;
                flag ^=1;
            }
            else if(i<n-2&&arr[i+1]==1){
                arr[i]=0;
                flag^=1;
            }
            else{
                arr[i]=1;
                i--;
                flag ^=1;
            }
            // printf("Turn :%d --> ",(flag^1)+1 );
            // printarr(arr,n );
        }
        if(flag){
            printf("Second\n");
        }
        else{
            printf("First\n");
        }

    }
}


#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);
    for(auto& e:a){
        cin>>e;
    }
    int ind = -1;
    for(int i = 0; i < n; i++){
        if(a[i] != 1){
            ind = i;
            break;
        }
    }
    if(ind == -1){
        if(n%2 == 0){
            cout<<"Second\n";
            return;
        }
        cout<<"First\n";
        return;
    }
    else{
        if(ind%2 != 0){
            cout<<"Second\n";
            return;
        }
        cout<<"First\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), 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;
}