r=""
for _ in range(int(input())):
    a=[int(i) for i in input().split()];m=101;s=0
    for i in a:
        if i%2==0:
            s+=i
            if m>i: m=i
    r+=str(s)+' '+str(m)+'\n'
print(r,end="")

9ff07f8623a047bc65ce500ce81a38e4b956c05e
<mask token>

<mask token>
for _ in range(int(input())):
    a = [int(i) for i in input().split()]
    m = 101
    s = 0
    for i in a:
        if i % 2 == 0:
            s += i
            if m > i:
                m = i
    r += str(s) + ' ' + str(m) + '\n'
print(r, end='')

r = ''
for _ in range(int(input())):
    a = [int(i) for i in input().split()]
    m = 101
    s = 0
    for i in a:
        if i % 2 == 0:
            s += i
            if m > i:
                m = i
    r += str(s) + ' ' + str(m) + '\n'
print(r, end='')

r=""
for _ in range(int(input())):
    a=[int(i) for i in input().split()];m=101;s=0
    for i in a:
        if i%2==0:
            s+=i
            if m>i: m=i
    r+=str(s)+' '+str(m)+'\n'
print(r,end="")
