#!/usr/bin/python3 import sys P = [] # # we read a set of points P in a 2D space from standard input. Each # input line contains two numbers representing the Cartesian # coordinates of one point. All points read from the input are # assumed to be distinct. # for l in sys.stdin: xy = l.split(' ') x = int(xy[0]) y = int(xy[1]) P.append((x, y)) def vec_sum(u,v): return (u[0]+v[0], u[1]+v[1]) def vec_diff(u,v): return (u[0]-v[0], u[1]-v[1]) def vec_rot_90(u): return (u[1],-u[0]) def is_square(p,q,r,s): pq = vec_diff(q,p) pr = vec_diff(r,p) ps = vec_diff(s,p) if vec_sum(pq, ps) == pr and (vec_rot_90(pq) == ps or vec_rot_90(ps) == pq): return True if vec_sum(pr, ps) == pq and (vec_rot_90(pr) == ps or vec_rot_90(ps) == pr): return True if vec_sum(pr, pq) == ps and (vec_rot_90(pr) == pq or vec_rot_90(pq) == pr): return True return False N = len(P) for i in range(3,N): for j in range(2,i): for k in range(1,j): for l in range(0,k): if is_square(P[i], P[j], P[k], P[l]): print(P[i], P[j], P[k], P[l])