//Задача "Дороги, дороги..."
//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_wa_add {
    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;

        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(int minv, int maxv) throws IOException {
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(in.readLine());
            }
            int v = Integer.parseInt(st.nextToken());
            if (v < minv || v > maxv) {
                throw new AssertionError("input is incorrect - limits exceeded");
            }
            return v;
        }

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

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

    private static void failOnDuplicate(List<? extends Point> list, Comparator<? super Point> cmp, String message) {
        if (list.size() >= 2) {
            Iterator<? extends Point> first = list.iterator();
            Iterator<? extends Point> second = list.iterator();
            second.next();
            while (second.hasNext()) {
                if (cmp.compare(second.next(), first.next()) == 0) {
                    throw new AssertionError(message);
                }
            }
        }
    }

    public static void main(String[] args) throws IOException {
        Random r = new Random();
        double cos = r.nextDouble();
        double sin = sqrt(1 - cos * cos);

        Portal io = new Portal("roads");
        int n = io.nextInt(2, 100000);
        int m = io.nextInt(1, 100000);
        Point[] pts = new Point[n];
        for (int i = 0; i < n; ++i) {
            Point p = new Point(io.nextInt(-1000, 1000), io.nextInt(-1000, 1000));
            p = p.rotated(cos, sin);
            pts[i] = p;
        }
        for (int i = 0; i < n; ++i) {
            pts[i].adj = new ArrayList<Point>();
        }
        for (int i = 0; i < m; ++i) {
            int src = io.nextInt(1, n) - 1;
            int trg = io.nextInt(1, n) - 1;
            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);
        failOnDuplicate(Arrays.asList(pts), xycmp, "Duplicate point");

        for (Point p : pts) {
            Collections.sort(p.adj, xycmp);
            failOnDuplicate(p.adj, xycmp, "Duplicate edge");
        }

        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 two = one.add(Y_UNIT);

                one = one.rotated(cos, -sin);
                two = two.rotated(cos, -sin);

                io.writePoint(one);
                io.writePoint(two);
                break;
            }

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