Binary string restoration

Given counts of each of the four adjacent pairs, build the lexicographically smallest binary string of length a+b+c+d+1 that realizes them, or report impossible.

Medium6StringGreedyImplementationMathInterviewNo attempts yetTime limit2sMemory limit256 MB

Problem

Consider a string of length nn made only of the characters 0 and 1. It has exactly n1n - 1 pairs of adjacent characters, and each pair is one of 00, 01, 10, 11.

You are given four integers aa, bb, cc, dd. Restore a string in which exactly aa adjacent pairs are 00, exactly bb are 01, exactly cc are 10, and exactly dd are 11. Its length is always n=a+b+c+d+1n = a + b + c + d + 1.

Several strings can satisfy the counts, so print the lexicographically smallest one. All candidates have the same length, so comparing them character by character from the first position is enough.

Input

The first line contains the number of tests tt (1t100001 \le t \le 10000).

Each of the next tt lines contains four integers aa, bb, cc, dd (0a,b,c,d200 \le a, b, c, d \le 20) separated by spaces. In every test a+b+c+d1a + b + c + d \ge 1.

Output

Print tt lines. For each test print the lexicographically smallest string that satisfies the counts. If no string satisfies them, print impossible.