Creep
Define the score of some binary string $$$T$$$ as the absolute difference between the number of zeroes and ones in it. (for example, $$$T=$$$ 010001 contains $$$4$$$ zeroes and $$$2$$$ ones, so the score of $$$T$$$ is $$$|4-2| = 2$$$).Define the creepiness of some binary string $$$S$$$ as the maximum score among all of its prefixes (for example, the creepiness of $$$S=$$$ 01001 is equal to $$$2$$$ because the score of the prefix $$$S[1 \ldots 4]$$$ is $$$2$$$ and the rest of the prefixes have a score of $$$2$$$ or less).Given two integers $$$a$$$ and $$$b$$$, construct a binary string consisting of $$$a$$$ zeroes and $$$b$$$ ones with the minimum possible creepiness.
In the first test case, the score of $$$S[1 \ldots 1]$$$ is $$$1$$$, and the score of $$$S[1 \ldots 2]$$$ is $$$0$$$.In the second test case, the minimum possible creepiness is $$$1$$$ and one of the other answers is 101.In the third test case, the minimum possible creepiness is $$$3$$$ and one of the other answers is 0001100.
The first line contains a single integer $$$t$$$ $$$(1\le t\le 1000)$$$  — the number of test cases. The description of the test cases follows.The only line of each test case contains two integers $$$a$$$ and $$$b$$$ ($$$ 1 \le a, b \le 100$$$)  — the numbers of zeroes and ones correspondingly.
For each test case, print a binary string consisting of $$$a$$$ zeroes and $$$b$$$ ones with the minimum possible creepiness. If there are multiple answers, print any of them.
import sys
input = sys.stdin.readline
for _ in range(int(input())):
    (a, b) = list(map(int, input().split()))
    ans = ''
    minn = min(a, b)
    if a >= b:
        ans = '01' * minn + '0' * (a - minn)
    else:
        ans = '10' * minn + '1' * (b - minn)
    print(ans)
for tests in range(int(input())):
    (z, o) = map(int, input().split())
    if z > o:
        print('01' * min(z, o) + '0' * (z - o))
    else:
        print('10' * min(z, o) + '1' * (o - z))
for _ in range(int(input())):
    (a, b) = map(int, input().split())
    print('01' * min(a, b) + '0' * max(0, a - b) + '1' * max(0, b - a))