x[6],i,a,b,c;main(d){for(;a=~scanf("%d",x+i)?++i:i&&i--%2|((a=x[2]-*x)+(d=x[5]-x[1])|(b=x[3]-x[1])-(c=x[4]-*x)&&a-d|b+c)?x[i]^=x[i%2]^=x[i]^=x[i%2],1:!printf(i?"%d %d":"%d",i?x[2]+c:-1,x[3]+d););}