if __name__ == "__main__":
    T = int(input())
    
    for _ in range(T) :
        x1, x2 = map(str, input().split(" "))
        a = int("0b" + x1, 2)
        b = int("0b" + x2, 2)
        c = a + b
        result = bin(c)
        print(result[2:])



95e9676ff79d6f1d8cbb75d6bdafc01e96db9603
<mask token>

if __name__ == '__main__':
    T = int(input())
    for _ in range(T):
        x1, x2 = map(str, input().split(' '))
        a = int('0b' + x1, 2)
        b = int('0b' + x2, 2)
        c = a + b
        result = bin(c)
        print(result[2:])

if __name__ == "__main__":
    T = int(input())
    
    for _ in range(T) :
        x1, x2 = map(str, input().split(" "))
        a = int("0b" + x1, 2)
        b = int("0b" + x2, 2)
        c = a + b
        result = bin(c)
        print(result[2:])


