https://www.acmicpc.net/problem/3009
import java.util.*
import java.lang.String.format
fun main(args: Array<String>) {
val s=Scanner(System.`in`)
var x1=s.nextInt()
var y1=s.nextInt()
var x=0
var y=0
var cx=0
var cy=0
for(i in 0 until 2){
var x2=s.nextInt()
var y2=s.nextInt()
if(x1==x2) cx++
else x=x2
if(y1==y2) cy++
else y=y2
}
print(format("%d %d",if(cx==1) x else x1,if(cy==1) y else y1))
}