https://www.acmicpc.net/problem/3009
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int x1=s.nextInt();
int y1=s.nextInt();
int x=0;
int y=0;
int cx=0;
int cy=0;
for(int i=0;i<2;i++){
int x2=s.nextInt();
int y2=s.nextInt();
if(x1==x2) cx++;
else x=x2;
if(y1==y2) cy++;
else y=y2;
}
System.out.format("%d %d",cx==1?x:x1,cy==1?y:y1);
}
}