#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(int argc, char **argv) {
int T;
scanf("%d", &T);
while (T-- != 0) {
int a, b, c, d;
scanf("%d%d%d%d", &a, &b, &c, &d);
int s1 = a + c;
int s2 = b + d;
if (s1 > s2 || (s1 == s2 && c > b))
puts("1");
else if (s2 > s1 || (s2 == s1 && b > c))
puts("2");
else
puts("-1");
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKCmludCBtYWluKGludCBhcmdjLCBjaGFyICoqYXJndikgewoJaW50IFQ7CglzY2FuZigiJWQiLCAmVCk7Cgl3aGlsZSAoVC0tICE9IDApIHsKCQlpbnQgYSwgYiwgYywgZDsKCQlzY2FuZigiJWQlZCVkJWQiLCAmYSwgJmIsICZjLCAmZCk7CgkJaW50IHMxID0gYSArIGM7CgkJaW50IHMyID0gYiArIGQ7CgkJaWYgKHMxID4gczIgfHwgKHMxID09IHMyICYmIGMgPiBiKSkKCQkJcHV0cygiMSIpOwoJCWVsc2UgaWYgKHMyID4gczEgfHwgKHMyID09IHMxICYmIGIgPiBjKSkKCQkJcHV0cygiMiIpOwoJCWVsc2UKCQkJcHV0cygiLTEiKTsKCX0KCXJldHVybiAwOwp9