{$r+,q+,o-}
{$apptype console}
uses
	Math;

type
	int = longint;

const
	MAXN = 100000;
	MAXM = 100000;

function gcd(u, v: int): int;
var
	tmp: int;

begin
	while (v > 0) do begin
		tmp := u mod v;
		u := v;
		v := tmp;
	end;
	result := u;
end;

var
	x, y: array [1..MAXN] of int;
	dist: array [1..MAXN] of int;
	ex, ey: array [1..MAXM] of int;
	n, m, a, b: int;

procedure qs(low, hi: int);
var
	middle, i, j, tmp: int;

begin
	middle := dist[low + random(hi - low + 1)];
	i := low;
	j := hi;
	while (i < j) do begin
		while (dist[i] < middle) do inc(i);
		while (dist[j] > middle) do dec(j);
		if (i <= j) then begin
			tmp := dist[i];
			dist[i] := dist[j];
			dist[j] := tmp;
			inc(i);
			dec(j);
		end;
	end;
	if (low < j) then qs(low, j);
	if (i < hi) then qs(i, hi);
end;

function calcDiff(line: extended): extended;
var
	tmp, low, hi, u, v, i: int;
	len, coef: extended;

begin
	result := 0;
	for i := 1 to m do begin
		u := ex[i];
		v := ey[i];
		low := a * x[u] + b * y[u];
		hi := a * x[v] + b * y[v];
		if (low > hi) then begin
			tmp := low;
			low := hi;
			hi := tmp;
		end;
		len := hypot(x[u] - x[v], y[u] - y[v]);
		if (low >= line) then begin
			result := result + len;
			continue;
		end;
		if (hi <= line) then begin
			result := result - len;
			continue;
		end;
		coef := 1.0 * (hi - line) / (line - low);
		result := result + len * (coef - 1) / (coef + 1);
	end;
end;

var
    i: int;
	low, hi, middle: int;
	x1, y1, x2, y2, leftBorder, rightBorder, pos: extended;

begin
	assign(input, 'roads.in'); reset(input);
	assign(output, 'roads.out'); rewrite(output);
	read(n, m);
	for i := 1 to n do begin
		read(x[i], y[i]);
	end;
	for i := 1 to m do begin
		read(ex[i], ey[i]);
	end;
	randseed := 24528951;
	a := 0; b:= 0;
	while (true) do begin
		a := 5000 + random(5000);
		b := 5000 + random(5000);
		if (gcd(a, b) = 1) then
			break;
	end;
	for i := 1 to n do begin
		dist[i] := a * x[i] + b * y[i];
	end;
	qs(1, n);

	low := 1;
	hi := n;
	while (low + 1 < hi) do begin
		middle := (low + hi) div 2;
		if (calcDiff(dist[middle]) > 0) then
			low := middle
		else
			hi := middle;
	end;
	leftBorder := calcDiff(dist[low]);
	rightBorder := calcDiff(dist[low + 1]);

	pos := dist[low] - leftBorder * (dist[low + 1] - dist[low]) / (rightBorder - leftBorder);
	x1 := a * pos / (a * a + b * b);
	y1 := b * pos / (a * a + b * b);
	x2 := x1 - 2 * b / sqrt(a * a + b * b);
	y2 := y1 + 2 * a / sqrt(a * a + b * b);

	writeln(x1: 0: 6, ' ', y1: 0: 6);
	writeln(x2: 0: 6, ' ', y2: 0: 6);
end.
