You are given a permutation p=[p_1, p_2, …, p_n] of integers from 1 to n. Let's call the number m (1 ≤ m ≤ n) beautiful, if there exists two indices l, r (1 ≤ l ≤ r ≤ n), such that the numbers [p_l, p_{l+1}, …, p_r] is a permutation of numbers 1, 2, …, m.

For example, let p = [4, 5, 1, 3, 2, 6]. In this case, the numbers 1, 3, 5, 6 are beautiful and 2, 4 are not. It is because:

  * if l = 3 and r = 3 we will have a permutation [1] for m = 1; 
  * if l = 3 and r = 5 we will have a permutation [1, 3, 2] for m = 3; 
  * if l = 1 and r = 5 we will have a permutation [4, 5, 1, 3, 2] for m = 5; 
  * if l = 1 and r = 6 we will have a permutation [4, 5, 1, 3, 2, 6] for m = 6; 
  * it is impossible to take some l and r, such that [p_l, p_{l+1}, …, p_r] is a permutation of numbers 1, 2, …, m for m = 2 and for m = 4. 



You are given a permutation p=[p_1, p_2, …, p_n]. For all m (1 ≤ m ≤ n) determine if it is a beautiful number or not.

Input

The first line contains the only integer t (1 ≤ t ≤ 1000) — the number of test cases in the input. The next lines contain the description of test cases.

The first line of a test case contains a number n (1 ≤ n ≤ 2 ⋅ 10^5) — the length of the given permutation p. The next line contains n integers p_1, p_2, …, p_n (1 ≤ p_i ≤ n, all p_i are different) — the given permutation p.

It is guaranteed, that the sum of n from all test cases in the input doesn't exceed 2 ⋅ 10^5.

Output

Print t lines — the answers to test cases in the order they are given in the input. 

The answer to a test case is the string of length n, there the i-th character is equal to 1 if i is a beautiful number and is equal to 0 if i is not a beautiful number.

Example

Input


3
6
4 5 1 3 2 6
5
5 3 1 2 4
4
1 4 3 2


Output


101011
11111
1001

Note

The first test case is described in the problem statement.

In the second test case all numbers from 1 to 5 are beautiful:

  * if l = 3 and r = 3 we will have a permutation [1] for m = 1; 
  * if l = 3 and r = 4 we will have a permutation [1, 2] for m = 2; 
  * if l = 2 and r = 4 we will have a permutation [3, 1, 2] for m = 3; 
  * if l = 2 and r = 5 we will have a permutation [3, 1, 2, 4] for m = 4; 
  * if l = 1 and r = 5 we will have a permutation [5, 3, 1, 2, 4] for m = 5. 

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.*;



import java.math.*;
import java.io.*;
import java.text.*;
import java.math.BigInteger;
public class Main {

	static class pair{
	long x;
		long y;
		public pair(long x,long y) {
			this.x=x;
			this.y=y;
		}
	}
	 public static boolean[] sieve(long n)
	    {
	        boolean[] prime = new boolean[(int)n+1];
	        Arrays.fill(prime,true);
	        prime[0] = false;
	        prime[1] = false;
	        long m = (long)Math.sqrt(n);
	        for(int i=2;i<=m;i++)
	        {
	            if(prime[i])
	            {
	                for(int k=i*i;k<=n;k+=i)
	                {
	                    prime[k] = false;
	                }
	            }
	        }
	        return prime;
	    } 
	public static void sort(long arr[], int l, int r)
	    {
	        if (l < r)
	        {
	            // Find the middle point
	            int m = (l+r)/2;
	 
	            // Sort first and second halves
	            sort(arr, l, m);
	            sort(arr , m+1, r);
	 
	            // Merge the sorted halves
	            merge(arr, l, m, r);
	        }
	    }
	 
	 
	public static void merge(long arr[], int l, int m, int r)
	    {
	        // Find sizes of two subarrays to be merged
	        int n1 = m - l + 1;
	        int n2 = r - m;
	 
	        /* Create temp arrays */
	        long L[] = new long[n1];
	        long R[] = new long[n2];
	 
	        //Copy data to temp arrays
	        for (int i=0; i<n1; ++i)
	            L[i] = arr[l + i];
	        for (int j=0; j<n2; ++j)
	            R[j] = arr[m + 1+ j];
	 
	 
	        /* Merge the temp arrays */
	 
	        // Initial indexes of first and second subarrays
	        int i = 0, j = 0;
	 
	        // Initial index of merged subarry array
	        int k = l;
	        while (i < n1 && j < n2)
	        {
	            if (L[i] <= R[j])
	            {
	                arr[k] = L[i];
	                i++;
	            }
	            else
	            {
	                arr[k] = R[j];
	                j++;
	            }
	            k++;
	        }
	 
	        /* Copy remaining elements of L[] if any */
	        while (i < n1)
	        {
	            arr[k] = L[i];
	            i++;
	            k++;
	        }
	 
	        /* Copy remaining elements of R[] if any */
	        while (j < n2)
	        {
	            arr[k] = R[j];
	            j++;
	            k++;
	        }
	    }
	 
	 
	 public static boolean[] primeseive(long n) {
		 boolean prime[]=new boolean[(int)n+1];
		 
		 Arrays.fill(prime, true);
		 
		 prime[0]=false;
		 prime[1]=false;
		 
		 int m=(int) Math.sqrt(n);
		 
		 for(int i=2;i<=m;i++) {
			 if(prime[i]) {
				 
				 for(int k=i*i;k<=n;k+=i) {
					 prime[k]=false;
				 }
			 }
		 }
		 
		 return prime;
	 }
	 public static String reverse(String input)
	 {
	   StringBuilder str  = new StringBuilder("") ;
	    
	     for(int i =input.length()-1 ; i >= 0  ; i-- )
	     {
	         str.append(input.charAt(i));
	     }
	     
	 return str.toString() ;
	 }
	 
	 public static ArrayList<Integer> allFactors(int n)
	 {   
	       ArrayList<Integer> list = new ArrayList<>() ;
	       
	     for(int i = 1; i*i <= n ;i++)
	     {
	           if( n % i == 0)
	           {
	               if(i*i == n)list.add(i) ;
	               else{ 
	          list.add(i);
	               list.add(n/i); 
	               }
	           }
	     }
	       
	      return list ; 
	 }
	  
	  
	 public static ArrayList<Long> allFactors(long n)
	 {   
	       ArrayList<Long> list = new ArrayList<>() ;
	       
	     for(long i = 1L; i*i <= n ;i++)
	     {
	           if( n % i == 0)
	           {
	               if(i*i == n) list.add(i) ;
	               else{  list.add(i) ; list.add(n/i) ; }
	              
	           }
	     }
	       
	      return list ; 
	 }
	 
	 
	   
//////////////////////////////////////////////////////////////////////////////////

/*
lowerBound - finds largest element equal or less than value paased
upperBound - finds smallest element equal or more than value passed
if not present return -1;
*/

public static long lowerBound(long[] arr,long k)
{
long ans=-1;

int start=0;
int end=arr.length-1;

while(start<=end)
{
  int mid=(start+end)/2;
   if(arr[mid]<=k){
  ans=arr[mid];
  start=mid+1;

  }
else{
       end=mid-1;
  }

}

  return ans;

}

public static int lowerBound(int[] arr,int k)
{
int ans=0;int start=0;int end=arr.length-1;

while(start<=end)
{
int mid=(start+end)/2;

if(arr[mid]<=k)
{
ans=mid;
start=mid+1;
}
else
{
end=mid-1;
}

}

return ans;

}


public static long upperBound(long[] arr,long k)
{
long ans=-1;int start=0;int end=arr.length-1;

while(start<=end)
{
int mid=(start+end)/2;

if(arr[mid]>=k)
{
ans=mid;
end=mid-1;
}
else
{
start=mid+1;
}

}

return ans;
}


public static int upperBound(int[] arr,int k)
{
int ans=arr.length-1; int start=0; 	int end=arr.length-1;

while(start<=end)
{
int mid=(start+end)/2;

if(arr[mid]>=k)
{
ans=mid;
end=mid-1;
}
else
{
start=mid+1;
}

}

return ans;
}

////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////

	 
	    
	    static int GCD(int a,int b)
	    {
	        if(b==0)
	        {
	            return a;
	        }
	        return GCD(b,a%b);
	    }
	 
	    
	    
	    static long gcdnik(long a,long b)
	    {
	        if(b==0)
	        {
	            return a;
	        }
	        return gcdnik(b,a%b);
	    }
	    
	    
	    static long CountCoPrimes(long n)
	    {
	        long res = n;
	        for(int i=2;i*i<=n;i++)
	        {
	            if(n%i==0)
	            {
	                while(n%i==0)
	                {
	                    n/=i;
	                }
	                res-=res/i;
	            }
	        }
	        if(n>1)
	        {
	            res-=res/n;
	        }
	        return res;
	    }
	 
	 
	    
	 
	    
	 
	    static boolean prime(int n)
	    {
	        for(int i=2;i*i<=n;i++)
	        {
	            if(i%2==0 ||i%3==0)
	            {
	                return false;
	            }
	        }
	        return true;
	    }

	static int length(int len) {
		
		if(len==1) {
			return 1;
		}
		else if(len==2) {
			return 3;
		}
		else if(len==3) {
			return 6;
		}
		else if(len==4) {
			return 10;
		}
		return 0;
	}
	
	
public static int LargestFour(int arr[]) {
	Arrays.sort(arr);

	int n=arr.length;
	int count=0;
	int sum=0;
	for(int i=n-1;i>=1;i--) {
		sum+=arr[i];
	
			count++;
			if(count==4) {
				break;
			
		}
		
	}
	
	if(count<4) {
		sum+=arr[0];
	}
	
	return sum;
}
//Nikunj Gupta
public static void insertionSort(int array[]) {  
    int n = array.length;  
    for (int j = 1; j < n; j++) {  
        int key = array[j];  
        int i = j-1;  
        while ( (i > -1) && ( array [i] > key ) ) {  
            array [i+1] = array [i];  
            i--;  
        }  
        array[i+1] = key;  
    }  
} 



  static String solve23(int n) {
int k=0;
while(true) {
	if(n-2020*k<0) {
		return "NO";
	}
	if((n-2020*k)%2021==0) {
		return "YES";
	}
	k++;
}
	  
	
	}
  public static String swapString(String a, int i, int j) {  
      char[] b =a.toCharArray();  
      char ch;  
      ch = b[i];  
      b[i] = b[j];  
      b[j] = ch;  
      return String.valueOf(b);  
  }  
	public static void permutation(String str,int start,int end,ArrayList<String> l,Set<String>set) {
		
		if(start==end-1) {
			set.add(str);
		}
		
		for(int i=start;i<end;i++) {
			str=swapString(str,start,i);
		
		permutation(str,start+1,end,l,set);
		
		swapString(str,start,i);
		
		}
		
		
		
	}


public static boolean solution(int j) {
	String str=Integer.toString(j);
	int zero=0;
	int one=0;
	for(int i=0;i<str.length();i++) {
		if(str.charAt(i)=='7') {
			one++;
		}else if(str.charAt(i)=='4') {
			zero++;
		}
	}
	
	
	if(one==zero) {
		return true;
	}
	
	
return false;
}
	
	
	

public static int lower_bound(ArrayList<Long> ar,long k)
{
    int s=0;
    int e=ar.size();
    while (s !=e)
    {
        int mid = s+e>>1;
        if (ar.get(mid) <k)
        {
            s=mid+1;
        }
        else
        {
            e=mid;
        }
    }
    if(s==ar.size())
    {
        return ar.size()-1;
    }
    return s;
} private static void printsubsequences(String c, String st) {
	// TODO Auto-generated method stub
	
	 
	 if(c.length()==0) {
		 System.out.println(st);
		 return;
	 }
	 
	 
	 printsubsequences(c.substring(1),st+c.charAt(0));
	 printsubsequences(c.substring(1),st);
	 
	 
}

private static boolean compare(HashMap<Character, Integer> smap, HashMap<Character, Integer> pmap) {
		// TODO Auto-generated method stub
	 
	 for(char ch:smap.keySet()) {
		 if(smap.get(ch)!=pmap.get(ch)) {
			 return false;
		 }
	 }
		return true;
	}


private static boolean BinarySearch(int search, int[] val, int n)
 {
		// TODO Auto-generated method stub
		
	 int start=0;
	 int end=val.length-1;
	 while(start<=end) {
		 int mid=(start+end)/2;
		 
		 
		 if(val[mid]==search) {
			 return true;
		 }
		 else if(val[mid]<search) {
			 start=mid+1;
		 }
		 else {
			 end=mid-1;
		 }
		 
	 }
	 return false;
	 }


	
 

	   
	 
	   

	    static long re(long n)
	    {
	        n+=1;
	        while(n%10==0)
	        {
	            n/=10;
	        }
	        return n;
	    }
	   static long xor(long n)
	    {
	 
	        if(n%4==0)
	        {
	            return n;
	        }
	        if(n%4==1)
	        {
	            return  1;
	        }
	        if(n%4==2)
	        {
	            return n+1;
	        }
	        return 0;
	    }
	 
	    static long xor(long a,long b)
	    {
	        return xor(b)^xor(a-1);
	    }
	 
	 	    static void swap(char c,char p)
	    {
	        char t = c;
	        c = p;
	        p = t;
	    }
	 
	    static long max(long n,long m)
	    {
	        return Math.max(n,m);
	    }
	    static long min(long n,long m)
	    {
	        return Math.min(n,m);
	    }
	 
 	    static int abs(int n)
	    {
	        return Math.abs(n);
	    }
	 
	    static class Scanner 
	    {
	        StringTokenizer st;
	        BufferedReader br;
	 
	        public Scanner(InputStream s){  br = new BufferedReader(new InputStreamReader(s));}
	 
	        public String next() throws IOException 
	        {
	            while (st == null || !st.hasMoreTokens()) 
	            {
	                st = new StringTokenizer(br.readLine());
	            }
	            return st.nextToken();
	        }
	 
	        public int nextInt() throws IOException {return Integer.parseInt(next());}
	        
	        public long nextLong() throws IOException {return Long.parseLong(next());}
	 
	        public String nextLine() throws IOException {return br.readLine();}
	 
	        public boolean ready() throws IOException {return br.ready();}
	 
	 
	    }
	 

public static void pairsort(ArrayList<pair>l){
	
	l.sort(new Comparator<pair>() {
		public int compare(pair o1,pair o2) {
			if(o1.x>o2.x) {
				return 1;
			}else {
				return -1;
			}
		}
	});

}


static class death implements Comparator<pair>{
	
	public int compare(pair o1,pair o2) {
		if(o1.x<o2.x) {
			return -1;
		}
		
		else if(o1.x>o2.x) {
			return 1;
		}
		else {
			return 1;
		}
		
	}
	
}


public static int[] findRedundantConnection(int[][] edges) {
 
	HashMap<Integer,HashSet<Integer>>hm=new HashMap<>();

for(int i=1;i<=edges.length;i++) {
	hm.put(i, new HashSet<Integer>());
}

for(int i=0;i<edges.length;i++) {
if(dfs(new HashSet<Integer>(),hm,edges[i][0],edges[i][1])) {
	return edges[i];
}
HashSet<Integer>p=hm.get(edges[i][0]);
p.add(edges[i][1]);
hm.put(edges[i][0],p);
HashSet<Integer>p1=hm.get(edges[i][1]);
p1.add(edges[i][0]);
hm.put(edges[i][1],p1);

}
return null;

}

public static boolean dfs(HashSet<Integer>vis,HashMap<Integer,HashSet<Integer>>hm,int src,int tar){
	if(src==tar) {
		return true;
	}

 
vis.add(src);

for(int next:hm.get(src)) {
	if(!vis.contains(next)) { 
		if(dfs(vis,hm,next,tar)) {return true;}
	}
}

return false;

}


public static void main(String[] args) throws IOException{
  Scanner s=new Scanner(System.in);
int op=s.nextInt();
while(op-- >0)
{
int n=s.nextInt();

int arr[]=new int[n+1];

for(int i=1;i<=n;i++) {
	int k=s.nextInt();
	arr[k]=i;

}


int min=Integer.MAX_VALUE;
int max=Integer.MIN_VALUE;

for(int i=0;i<n;i++) {
	min=Math.min(min,arr[i+1]);
	max=Math.max(max,arr[i+1]);
	if(max-min==i) {
		System.out.print(1);
	}else {
		System.out.print(0);
	}

}

System.out.println();
}


}


  
	
		




  
  
  
  
  






		
	 
	 
	
	 
	 
	 
	
 



  
  static double solve(int or,int r,int c,int k,double dp[][]) {
	
	  if(r==1&&c>1) {
		  return 0;
	  }
	  if(r==1&&c==1) {
		  Double ty=new Double(k);
		  ty=ty-1;
		  double div=2;
		  double val=ty/div;
		//  System.out.println("val is"+val);
		  dp[r][c]=val;
		  return val;
	  }
	  
	  if(c==0) {
		  return 0;
	  }
	  
	  if(dp[r][c]!=-1) {
		  return dp[r][c];
	  }
	  
	  
	  
	  double cal1=solve(or,r-1,c-1,k,dp);
	  double cal2=solve(or,r-1,c,k,dp);
	// System.out.println(cal1+" "+cal2);
	  double div=2;
	  if(r !=or) {
	  dp[r][c]=((cal1+cal2)-1)/div;
	  }else {
		  dp[r][c]=((cal1+cal2));  
	  }
	  
	  return dp[r][c];
  
  }
  
  




public static long mod(long x){
    //long M=1000000007;
    
	long M=998244353;
	return (int)((x%M+M)%M);
}

static long add(long a,long b){
    return mod(mod(a)+mod(b));
}


public static  long mul(long a,long b){
    return mod(mod(a)*mod(b));
}

static void printAllKLengthRec(char[] set,
        String prefix,
        int n, int k,ArrayList<String>l)
{

// Base case: k is 0,
// print prefix
if (k == 0)
{
//System.out.println(prefix);
l.add(prefix);
	return;
}

// One by one add all characters
// from set and recursively
// call for k equals to k-1
for (int i = 0; i < n; ++i)
{

// Next character of input added
String newPrefix = prefix + set[i];

// k is decreased, because
// we have added a new character
printAllKLengthRec(set, newPrefix,
         n, k - 1,l);
}
}




	 
	 
	 
//	class Pair implements Comparable<Pair>
//	{
//	   int x,y;
//	    public Pair(int x,int y)
//	    {
//	        this.x = x;
//	        this.y = y;
//	    }
//	    public int compareTo(Pair o)
//	    {
//	        return this.y-o.y;
//	    }
//	}
	
	}

