Problem: You are given a permutation of integers from to . Let's call the number () beautiful, if there exists two indices (), such that the numbers is a permutation of numbers .
For example, let . In this case, the numbers are beautiful and are not. It is because:
- if and we will have a permutation for ;
- if and we will have a permutation for ;
- if and we will have a permutation for ;
- if and we will have a permutation for ;
- it is impossible to take some and , such that is a permutation of numbers for and for .
You are given a permutation . For all () determine if it is a beautiful number or not.
Input Format: The first line contains the only integer () — 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 () — the length of the given permutation . The next line contains integers (, all are different) — the given permutation .
It is guaranteed, that the sum of from all test cases in the input doesn't exceed .
Output Format: Print 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 , there the -th character is equal to if is a beautiful number and is equal to if is not a beautiful number.
Note: The first test case is described in the problem statement.
In the second test case all numbers from to are beautiful:
- if and we will have a permutation for ;
- if and we will have a permutation for ;
- if and we will have a permutation for ;
- if and we will have a permutation for ;
- if and we will have a permutation for .