#include<bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
int t; scanf("%d", &t);
while(t--) {
scanf("%d%d%d%d", &a, &b, &c, &d);
if(a+c > b+d)
puts("1");
else if(a+c < b+d)
puts("2");
else {
if(b < c)
puts("1");
else if(b > c)
puts("2");
else
puts("-1");
}
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJaW50IGEsIGIsIGMsIGQ7CglpbnQgdDsgc2NhbmYoIiVkIiwgJnQpOwoJd2hpbGUodC0tKSB7CgkJc2NhbmYoIiVkJWQlZCVkIiwgJmEsICZiLCAmYywgJmQpOwoJCWlmKGErYyA+IGIrZCkKCQkJcHV0cygiMSIpOwoJCWVsc2UgaWYoYStjIDwgYitkKQoJCQlwdXRzKCIyIik7CgkJZWxzZSB7CgkJCWlmKGIgPCBjKSAKCQkJCXB1dHMoIjEiKTsKCQkJZWxzZSBpZihiID4gYykKCQkJCXB1dHMoIjIiKTsKCQkJZWxzZQoJCQkJcHV0cygiLTEiKTsKCQl9Cgl9CglyZXR1cm4gMDsKfQ==