按题意直接模拟即可。

AC code:

#include <bits/stdc++.h>
using namespace std;

int main() {
	long long x1, x2, y1, y2;//不开long long见祖宗
	cin >> x1 >> y1 >> x2 >> y2;
	if (x1 != x2 && y1 != y2) {
        cout << x1 << " " << y2 << endl;
    } else if (x1 == x2 && y1 != y2) {
        cout << "0" << " " << y2 << endl;
    } else {
        cout << x1 << " " << "0" << endl;
    }
	return 0;
}