// Задача "Дороги, дороги, дороги..."
// Автор решения: Сергей Мельников, melnikov@rain.ifmo.ru
// Неверное, медленное решение
// без проверок входного файла
import java.io.*;
import java.util.*;

public class roads_sm_wrong_noassert extends Thread {

	class Point {
		double x, y;

		public Point(double x, double y) {
			this.x = x;
			this.y = y;
		}

		double dist(Point p) {
			return Math.sqrt((x - p.x) * (x - p.x) + (y - p.y) * (y - p.y));
		}
		double cons(double A, double B, double C){
			return A*x+B*y+C;
		}
		@Override
		public String toString() {
			return x+" "+y;
		}
	}

	class Segment {
		Point a, b;
		Point mid;
		double A, B, C;
		double len;

		public Segment(Point a, Point b) {
			this.a = a;
			this.b = b;
			mid = new Point((a.x + b.x) / 2, (a.y + b.y) / 2);
			len = a.dist(b);
			A = b.y - a.y;
			B = a.x - b.x;
			C = -a.x * (b.y - a.y) + a.y * (b.x - a.x);
		}

		double len() {
			return len;
		}

		double part(double lA, double lB, double lC) {
			if (Math.abs(a.cons(lA, lB, lC))<EPS &&Math.abs(b.cons(lA, lB, lC))<EPS  ){
				return len()/2;
			}
			// A*x+B*y+C=0
			// lA*x+lB*y+lC=0
			// x = (B*y+C) /A
			// (lA/A*B + lB)*y + lA/A*C +  +lC = 0
			// y = -(lA/A*C +  +lC)/(lA/A*B + lB)
			Point p;
			if (Math.abs(A)>EPS){
				double y = -((lA/A)*C +  +lC)/((lA/A)*B + lB);
				double x = B*y+C;
				p = new Point(x,y);
			}else{
				double y = -((A/lA)*lC +  C)/((A/lA)*lB + B);
				double x = lB*y+lC;
				p = new Point(x,y);
			}
			if (Math.abs(a.dist(p)+b.dist(p)-len())<EPS){
				if (a.cons(lA, lB, lC)<0){
					return a.dist(p);
				}else{
					return b.dist(p);
				}
			}else{
				if (a.cons(lA, lB, lC)<0){
					return len();
				}else{
					return 0;
				}
			}
		}
	}

	final double EPS = 1e-6;

	void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		Point p[] = new Point[n];
		for (int i = 0; i < p.length; i++) {
			p[i] = new Point(nextInt(), nextInt());
		}
		Segment[] s = new Segment[m];
		double slen = 0;
		for (int i = 0; i < m; i++) {
			int a = nextInt();
			int b = nextInt();
			myAssert(1 <= a && a <= n);
			myAssert(1 <= b && b <= n);
			s[i] = new Segment(p[a - 1], p[b - 1]);
			slen += s[i].len();
		}

		for (int i = 0; i < s.length; i++) {
			for (int j = i + 1; j < s.length; j++) {
				Point a = s[i].mid;
				Point b = s[j].mid;
				// (x-a.x)/(b.x-a.x) = (y-a.y)/(b.y-a.y)
				// x*(b.y-a.y)+y*(a.x-b.x)-a.x*(b.y-a.y)+a.y*(b.x-a.x) = 0
				double A = b.y - a.y;
				double B = a.x - b.x;
				double C = -a.x * (b.y - a.y) + a.y * (b.x - a.x);
				double q = 0; 
				for (int k = 0; k < s.length; k++) {
					q+=s[k].part(A, B, C);
				}
				if (Math.abs(2*q-slen)<EPS){
					out.println(a);
					out.println(b);
					return;
				}
			}
		}

	}

	void myAssert(boolean b) {
		if (!b)
			throw new AssertionError();
	}

	StreamTokenizer st;
	PrintWriter out;

	int nextInt() {
		try {
			st.nextToken();
		} catch (IOException e) {
			return 0;
		}
		return (int) st.nval;
	}

	public void run() {
		try {
			st = new StreamTokenizer(new FileReader("roads.in"));
			out = new PrintWriter(new BufferedWriter(
					new FileWriter("roads.out")));
			solve();
			out.flush();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static void main(String[] args) {
		new roads_sm_wrong_noassert().start();
	}

}
