fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long n;
  6. cin >> n;
  7. while(n--){
  8. long long l1,r1,l2,r2;
  9. cin >> l1 >> r1 >> l2 >> r2 ;
  10.  
  11. if(r1==l2)
  12. cout << l1 << " " << r2 << endl;
  13. else
  14. cout << r1 <<" " <<l2<< endl;}
  15. return 0;
  16. }
Success #stdin #stdout 0s 4504KB
stdin
4
1 2 1 2
3 4 4 5
5 6 7 9
3 4 5 6
stdout
2 1
3 5
6 7
4 5