//Задача "Дороги, дороги..."
//7-я Интернет-олимпиада сезона 2008-2009, усложненный уровень
//Автор залачи: Федор Царев, tsarev@rain.ifmo.ru
//Автор решения: Максим Буздалов, buzdalov@rain.ifmo.ru

//Корректное решение, не проверяет корректность входных данных.

import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class roads_mb_noassert {
    private static final double EPS = 1e-9;

    private static boolean equal(double a, double b) {
        return abs(a - b) <= EPS;
    }

    private static boolean lessEq(double a, double b) {
        return a < b || equal(a, b);
    }

    private static boolean less(double a, double b) {
        return a < b && !equal(a, b);
    }

    private static class Point {
        public final double x, y;
        public List<Point> adj = null;

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

        public Point add(Point arg) {
            return new Point(x + arg.x, y + arg.y);
        }

        public Point subtract(Point arg) {
            return new Point(x - arg.x, y - arg.y);
        }

        public double vmul(Point arg) {
            return x * arg.y - y * arg.x;
        }

        public double smul(Point arg) {
            return x * arg.x + y * arg.y;
        }

        public double len2() {
            return smul(this);
        }

        public double length() {
            return sqrt(len2());
        }

        public double distanceTo(Point arg) {
            return sqrt((x - arg.x) * (x - arg.x) + (y - arg.y) * (y - arg.y));
        }

        public Point rotated(double cos, double sin) {
            return new Point(x * cos - y * sin, x * sin + y * cos);
        }

        public Point normalized() {
            double len = length();
            return new Point(x / len, y / len);
        }

        public String toString() {
            return String.format(Locale.US, "(%f; %f)", x, y);
        }
    }

    private static class Portal {
        private BufferedReader in;
        private StringTokenizer st;
        private PrintWriter out;

        public Portal(String filename) throws IOException {
            in = new BufferedReader(new FileReader(filename + ".in"));
            st = new StringTokenizer("");
            out = new PrintWriter(filename + ".out");
        }

        public int nextInt() throws IOException {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(in.readLine());
            }
            return Integer.parseInt(st.nextToken());
        }

        public void writePoint(Point arg) throws IOException {
            out.println(arg.x + " " + arg.y);
        }

        public void close() throws IOException {
            in.close();
            out.close();
        }
    }

    public static void main(String[] args) throws IOException {
        Portal io = new Portal("roads");
        int n = io.nextInt();
        int m = io.nextInt();

        Point[] pts = new Point[n];
        for (int i = 0; i < n; ++i) {
            pts[i] = new Point(io.nextInt(), io.nextInt());
        }

        int[] srcs = new int[m];
        int[] trgs = new int[m];

        Point sumDir = new Point(0, 0);

        for (int i = 0; i < m; ++i) {
            srcs[i] = io.nextInt() - 1;
            trgs[i] = io.nextInt() - 1;
            Point dir = pts[trgs[i]].subtract(pts[srcs[i]]);
            if (equal(dir.x, 0)) {
                if (less(dir.y, 0)) {
                    dir = new Point(-dir.x, -dir.y);
                }
            } else if (less(dir.x, 0)) {
                dir = new Point(-dir.x, -dir.y);
            }
            sumDir = sumDir.add(dir);
        }

        sumDir = sumDir.normalized();
        double cos = sumDir.x;
        double sin = -sumDir.y;

        for (int i = 0; i < n; ++i) {
            pts[i] = pts[i].rotated(cos, sin);
            pts[i].adj = new ArrayList<Point>();
        }
        for (int i = 0; i < m; ++i) {
            int src = srcs[i];
            int trg = trgs[i];
            pts[src].adj.add(pts[trg]);
            pts[trg].adj.add(pts[src]);
        }

        Comparator<Point> xycmp = new Comparator<Point>() {
            public int compare(Point a, Point b) {
                if (equal(a.x, b.x)) {
                    if (equal(a.y, b.y)) {
                        return 0;
                    } else {
                        return Double.compare(a.y, b.y);
                    }
                } else {
                    return Double.compare(a.x, b.x);
                }
            }
        };

        Arrays.sort(pts, xycmp);

        double balance = 0;
        double onSweep = 0;
        for (Point ps : pts) {
            for (Point pt : ps.adj) {
                balance += ps.distanceTo(pt);
            }
        }
        balance /= 4;

        final Point Y_UNIT = new Point(0, 1);

        for (int i = 0; i + 1 < n; ++i) {
            Point curr = pts[i];
            Point next = pts[i + 1];
            for (Point cngb : curr.adj) {

                double num = curr.distanceTo(cngb);
                double den = abs(curr.x - cngb.x);
                if (!equal(den, 0)) {
                    num /= den;
                }

                if (xycmp.compare(curr, cngb) < 0) {
                    onSweep += num;
                } else {
                    onSweep -= num;
                }
            }

            if (lessEq(balance, onSweep * (next.x - curr.x)) && !equal(curr.x, next.x)) {
                double t = balance / onSweep;
                Point one = new Point(curr.x + t, curr.y + t * (next.y - curr.y) / (next.x - curr.x));
                Point two1 = one.add(Y_UNIT);
                Point two2 = one.subtract(Y_UNIT);

                one = one.rotated(cos, -sin);
                two1 = two1.rotated(cos, -sin);
                two2 = two2.rotated(cos, -sin);

                io.writePoint(one);
                if (abs(two1.x) <= 1e3 && abs(two1.y) <= 1e3) {
                    io.writePoint(two1);
                } else {
                    io.writePoint(two2);
                }
                break;
            }

            balance -= onSweep * (next.x - curr.x);
        }
        io.close();
    }
}
