On the competitive programming platform CodeCook, every person has a rating graph described by an array of integers a of length n. You are now updating the infrastructure, so you've created a program to compress these graphs.

The program works as follows. Given an integer parameter k, the program takes the minimum of each contiguous subarray of length k in a.

More formally, for an array a of length n and an integer k, define the k-compression array of a as an array b of length n-k+1, such that $$$b_j =min_{j≤ i≤ j+k-1}a_i$$$

For example, the 3-compression array of [1, 3, 4, 5, 2] is [min\{1, 3, 4\}, min\{3, 4, 5\}, min\{4, 5, 2\}]=[1, 3, 2].

A permutation of length m is an array consisting of m distinct integers from 1 to m in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation (2 appears twice in the array) and [1,3,4] is also not a permutation (m=3 but there is 4 in the array).

A k-compression array will make CodeCook users happy if it will be a permutation. Given an array a, determine for all 1≤ k≤ n if CodeCook users will be happy after a k-compression of this array or not.

Input

The first line contains a single integer t (1≤ t≤ 10^4) — the number of test cases.

The first line of the description of each test case contains a single integer n (1≤ n≤ 3⋅ 10^5) — the length of the array.

The second line of the description of each test case contains n integers a_1,…,a_n (1≤ a_i≤ n) — the elements of the array.

It is guaranteed, that the sum of n for all test cases does not exceed 3⋅ 10^5.

Output

For each test case, print a binary string of length n. 

The k-th character of the string should be 1 if CodeCook users will be happy after a k-compression of the array a, and 0 otherwise. 

Example

Input


5
5
1 5 3 4 2
4
1 3 2 1
5
1 3 3 3 2
10
1 2 3 4 5 6 7 8 9 10
3
3 3 2


Output


10111
0001
00111
1111111111
000

Note

In the first test case, a=[1, 5, 3, 4, 2].

  * The 1-compression of a is [1, 5, 3, 4, 2] and it is a permutation. 
  * The 2-compression of a is [1, 3, 3, 2] and it is not a permutation, since 3 appears twice. 
  * The 3-compression of a is [1, 3, 2] and it is a permutation. 
  * The 4-compression of a is [1, 2] and it is a permutation. 
  * The 5-compression of a is [1] and it is a permutation. 
import java.util.ArrayList;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {

	public static void main(final String[] args) {
		new Main();
	}

	public Main() {
		final FastScanner fs = new FastScanner();
		final java.io.PrintWriter out = new java.io.PrintWriter(System.out);
		solve(fs, out);
		out.flush();
	}

	public void solve(final FastScanner fs, final java.io.PrintWriter out) {
		int t = fs.nextInt();
		while(t --> 0) {
			final int n = fs.nextInt();
			final int[] a = new int[n];
			for (int i = 0;i < n;++ i) a[i] = fs.nextInt();
			final ArrayList<ArrayList<Integer>> point = new ArrayList<>();
			for (int i = 0;i <= n;++ i) point.add(new ArrayList<>());
			for (int i = 0;i < n;++ i) point.get(a[i]).add(i);
			final TreeSet<Integer> set = new TreeSet<>();
			final TreeMap<Integer, Integer> map = new TreeMap<>();
			for (int i = -1;i <= n;++ i) set.add(i);
			final ArrayList<ArrayList<Integer>> query = new ArrayList<>();
			for (int i = 0;i <= n;++ i) query.add(new ArrayList<>());
			for (int i = n;i > 0;-- i) {
				set.removeAll(point.get(i));
				for (final int j : point.get(i)) {
					final int rem = set.higher(j) - set.lower(j) - 1;
					query.get(rem).add(i);
					map.merge(i, 1, (l, r) -> l + r);
				}
			}
			final char[] ans = new char[n];
			for (int i = 0;i < n;++ i) {
				for (final int j : query.get(i)) {
					map.compute(j, (k, v) -> v == 1 ? null : v - 1);
				}
				ans[i] = map.size() == n - i && map.lastKey() == n - i ? '1' : '0';
			}
			out.println(ans);
		}
	}

	static class Query implements Comparable<Query> {
		int rem;
		int x, y;
		Query(final int rem, final int x, final int y) {
			this.rem = rem;
			this.x = x;
			this.y = y;
		}
		@Override
		public int compareTo(final Query o) {
			return Integer.compare(rem, o.rem);
		}

	}
}

class FastScanner {

	private final java.io.InputStream in = System.in;
	private final byte[] buffer = new byte[8192];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) return true;
		ptr = 0;
		try {
			buflen = in.read(buffer);
		} catch (final java.io.IOException e) {
			e.printStackTrace();
		}
		return buflen > 0;
	}

	private byte readByte() {
		return hasNextByte() ? buffer[ptr++ ] : -1;
	}

	private static boolean isPrintableChar(final byte c) {
		return 32 < c || c < 0;
	}

	private static boolean isNumber(final int c) {
		return '0' <= c && c <= '9';
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++ ;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext()) throw new java.util.NoSuchElementException();
		final StringBuilder sb = new StringBuilder();
		byte b;
		while (isPrintableChar(b = readByte()))
			sb.appendCodePoint(b);
		return sb.toString();
	}

	public final char nextChar() {
		if (!hasNext()) throw new java.util.NoSuchElementException();
		return (char)readByte();
	}

	public final long nextLong() {
		if (!hasNext()) throw new java.util.NoSuchElementException();
		long n = 0;
		try {
			byte b = readByte();
			if (b == '-') {
				while (isNumber(b = readByte()))
					n = n * 10 + '0' - b;
				return n;
			} else if (!isNumber(b)) throw new NumberFormatException();
			do
				n = n * 10 + b - '0';
			while (isNumber(b = readByte()));
		} catch (final java.util.NoSuchElementException e) {}
		return n;
	}

	public final int nextInt() {
		if (!hasNext()) throw new java.util.NoSuchElementException();
		int n = 0;
		try {
			byte b = readByte();
			if (b == '-') {
				while (isNumber(b = readByte()))
					n = n * 10 + '0' - b;
				return n;
			} else if (!isNumber(b)) throw new NumberFormatException();
			do
				n = n * 10 + b - '0';
			while (isNumber(b = readByte()));
		} catch (final java.util.NoSuchElementException e) {}
		return n;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

class Arrays {

	public static void sort(final int[] array) {
		int l, min = 0xFFFFFFFF, max = 0;
		for (l = 0; l < array.length; ++l) {
			final int i = array[l];
			min &= i;
			max |= i;
			if ((i & 0x80000000) == 0) break;
		}
		for (int r = l + 1; r < array.length; ++r) {
			final int i = array[r];
			min &= i;
			max |= i;
			if ((i & 0x80000000) != 0) {
				array[r] = array[l];
				array[l++ ] = i;
			}
		}
		final int use = min ^ max, bit = Integer.highestOneBit(use & 0x7FFFFFFF);
		if (bit == 0) return;
		sort(array, 0, l, use, bit);
		sort(array, l, array.length, use, bit);
	}

	private static void sort(final int[] array, final int left, final int right, final int use, int digit) {
		if (right - left <= 96) {
			for (int i = left + 1; i < right; ++i) {
				final int tmp = array[i];
				int tmp2, j;
				for (j = i; j > left && (tmp2 = array[j - 1]) > tmp; --j)
					array[j] = tmp2;
				array[j] = tmp;
			}
			return;
		}
		int l = left;
		while (l < right && (array[l] & digit) == 0)
			++l;
		for (int r = l + 1; r < right; ++r) {
			final int i = array[r];
			if ((i & digit) == 0) {
				array[r] = array[l];
				array[l++ ] = i;
			}
		}
		if ((digit = Integer.highestOneBit(use & digit - 1)) == 0) return;
		sort(array, left, l, use, digit);
		sort(array, l, right, use, digit);
	}

	public static void sort(final long[] array) {
		int l;
		long min = 0xFFFFFFFFFFFFFFFFL, max = 0;
		for (l = 0; l < array.length; ++l) {
			final long i = array[l];
			min &= i;
			max |= i;
			if ((i & 0x8000000000000000L) == 0) break;
		}
		for (int r = l + 1; r < array.length; ++r) {
			final long i = array[r];
			min &= i;
			max |= i;
			if ((i & 0x8000000000000000L) != 0) {
				array[r] = array[l];
				array[l++ ] = i;
			}
		}
		final long use = min ^ max, bit = Long.highestOneBit(use & 0x7FFFFFFFFFFFFFFFL);
		if (bit == 0) return;
		sort(array, 0, l, use, bit);
		sort(array, l, array.length, use, bit);
	}

	private static void sort(final long[] array, final int left, final int right, final long use, long digit) {
		if (right - left <= 96) {
			for (int i = left + 1, j; i < right; ++i) {
				final long tmp = array[i];
				long tmp2;
				for (j = i; j > left && (tmp2 = array[j - 1]) > tmp; --j)
					array[j] = tmp2;
				array[j] = tmp;
			}
			return;
		}
		int l = left;
		while (l < right && (array[l] & digit) == 0)
			++l;
		for (int r = l + 1; r < right; ++r) {
			final long i = array[r];
			if ((i & digit) == 0) {
				array[r] = array[l];
				array[l++ ] = i;
			}
		}
		if ((digit = Long.highestOneBit(use & digit - 1)) == 0) return;
		sort(array, left, l, use, digit);
		sort(array, l, right, use, digit);
	}
}

class IntMath {

	public static int gcd(int a, int b) {
		while (a != 0)
			if ((b %= a) != 0) a %= b;
			else return a;
		return b;
	}

	public static int gcd(final int... array) {
		int ret = array[0];
		for (int i = 1; i < array.length; ++i)
			ret = gcd(ret, array[i]);
		return ret;
	}

	public static long gcd(long a, long b) {
		while (a != 0)
			if ((b %= a) != 0) a %= b;
			else return a;
		return b;
	}

	public static long gcd(final long... array) {
		long ret = array[0];
		for (int i = 1; i < array.length; ++i)
			ret = gcd(ret, array[i]);
		return ret;
	}

	public static long lcm(final long a, final long b) {
		return a / gcd(a, b) * b;
	}

	public static int pow(final int a, int b) {
		int ans = 1;
		for (int mul = a; b > 0; b >>= 1, mul *= mul)
			if ((b & 1) != 0) ans *= mul;
		return ans;
	}

	public static long powLong(final long a, long b) {
		long ans = 1;
		for (long mul = a; b > 0; b >>= 1, mul *= mul)
			if ((b & 1) != 0) ans *= mul;
		return ans;
	}

	public static int pow(final int a, int b, final int mod) {
		if (b < 0) b = b % (mod - 1) + mod - 1;
		long ans = 1;
		for (long mul = a; b > 0; b >>= 1, mul = mul * mul % mod)
			if ((b & 1) != 0) ans = ans * mul % mod;
		return (int)ans;
	}

	public static int floorsqrt(final long n) {
		return (int)Math.sqrt(n + 0.1);
	}

	public static int ceilsqrt(final long n) {
		return n <= 1 ? (int)n : (int)Math.sqrt(n - 0.1) + 1;
	}
}