https://pintia.cn/problem-sets/994805260223102976/problems/994805277847568384
#include <iostream>
using namespace std;
int main(){
int n, j_lose = 0, y_lose = 0, a, b, c, d;
cin >> n;
for(int i = 0; i < n; i++){
cin >> a >> b >> c >> d;
if(b == a+c && b != d)
y_lose++;
if(d == a+c && d != b)
j_lose++;
}
cout << j_lose << " " << y_lose;
return 0;
}