import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;

public class Stress {
    static int done = 0;

    static final Random rand = new Random(324324324);
    static final int MAX_N = 10;
    static final int MAX = 20;

    static class Point {
        int x, y;

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

        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + x;
            result = prime * result + y;
            return result;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (getClass() != obj.getClass())
                return false;
            Point other = (Point) obj;
            if (x != other.x)
                return false;
            if (y != other.y)
                return false;
            return true;
        }

    }

    static int gcd(int x, int y) {
        return x == 0 ? y : gcd(y % x, x);
    }

    static class Line {
        int A, B, C;

        boolean onLine(Point p) {
            return A * p.x + B * p.y + C == 0;
        }

        Line(Point from, Point to) {
            A = to.y - from.y;
            B = from.x - to.x;
            C = -(A * from.x + B * from.y);
            int g = gcd(gcd(Math.abs(A), Math.abs(B)), Math.abs(C));
            A /= g;
            B /= g;
            C /= g;
            if (A < 0) {
                A *= -1;
                B *= -1;
                C *= -1;
            } else {
                if (A == 0) {
                    if (B < 0) {
                        A *= -1;
                        B *= -1;
                        C *= -1;
                    } else {
                        if (B == 0) {
                            if (C < 0) {
                                A *= -1;
                                B *= -1;
                                C *= -1;
                            }
                        }
                    }
                }
            }
        }

        @Override
        public int hashCode() {
            final int prime = 31;
            int result = 1;
            result = prime * result + A;
            result = prime * result + B;
            result = prime * result + C;
            return result;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)
                return false;
            if (getClass() != obj.getClass())
                return false;
            Line other = (Line) obj;
            if (A != other.A)
                return false;
            if (B != other.B)
                return false;
            if (C != other.C)
                return false;
            return true;
        }

    }

    static class TestCase {
        ArrayList<Point[]> lines;
        Point start, end;

        public TestCase() {
            super();
            lines = new ArrayList<>();
        }

    }

    static void print(TestCase tc) throws IOException {
        PrintWriter out = new PrintWriter("saferoute.in");
        out.println(tc.lines.size());
        for (Point[] pts : tc.lines) {
            out.println(pts[0].x + " " + pts[0].y + " " + pts[1].x + " "
                    + pts[1].y);
        }
        out.println(tc.start.x + " " + tc.start.y);
        out.println(tc.end.x + " " + tc.end.y);
        out.close();
    }

    static Point genRandomPoint() {
        return new Point(rand.nextInt(MAX * 2) - MAX, rand.nextInt(MAX * 2)
                - MAX);
    }

    static Point genRandomPointOnLine(Point[] line) {
        int g = gcd(Math.abs(line[1].x - line[0].x),
                Math.abs(line[1].y - line[0].y));
        int dx = (line[1].x - line[0].x) / g;
        int dy = (line[1].y - line[0].y) / g;
        while (true) {
            int mul = rand.nextInt(MAX * 2) - MAX;
            Point cur = new Point(line[0].x + mul * dx, line[0].y + mul * dy);
            if (cur.x >= -MAX && cur.x <= MAX && cur.y >= -MAX && cur.y <= MAX)
                return cur;
        }
    }

    static void genRandomTest() throws IOException {
        int n = 3;
        TestCase tc = new TestCase();
        int ptsDiff = 2 + rand.nextInt(2 * MAX_N);
        while (ptsDiff * (ptsDiff - 1) / 2 < n)
            ptsDiff++;
        Point[] all = new Point[ptsDiff];
        HashSet<Point> pts = new HashSet<>();
        for (int i = 0; i < all.length; i++) {
            all[i] = genRandomPoint();
            if (pts.contains(all[i])) {
                i--;
                continue;
            }
            pts.add(all[i]);
        }
        HashSet<Line> lines = new HashSet<>();
        for (int i = 0; i < n; i++) {
            int f = rand.nextInt(ptsDiff);
            int s = f;
            while (f == s) {
                s = rand.nextInt(ptsDiff);
            }
            Line l = new Line(all[f], all[s]);
            if (lines.contains(l)) {
                i--;
                continue;
            }
            lines.add(l);
            tc.lines.add(new Point[] { all[f], all[s] });
        }
        Point start = null, end = null;
        while (true) {
            Point[] line = tc.lines.get(rand.nextInt(n));
            Point gen = genRandomPointOnLine(line);
            int lieOn = 0;
            for (Line l : lines) {
                if (l.onLine(gen)) {
                    lieOn++;
                }
            }
            if (lieOn != 1)
                continue;
            if (start == null) {
                start = gen;
            } else {
                if (start.x == gen.x && start.y == gen.y)
                    continue;
                end = gen;
                break;
            }
        }
        tc.start = start;
        tc.end = end;
        print(tc);
    }

    void run() throws IOException {
        int z = 0;
        while (true) {
            System.out.println(z++);
            genRandomTest();
            saferoute_as as = new saferoute_as();
            as.run();
            Scanner ja = new Scanner(new File("saferoute.out"));
            double aans = ja.nextDouble();
            ja.close();
            saferoute_bm bm = new saferoute_bm();
            bm.run();
            ja = new Scanner(new File("saferoute.out"));
            double bans = ja.nextDouble();
            ja.close();
            if (Math.abs(aans - bans) > 1e-9) {
                break;
            }
        }
    }

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new Stress().run();
    }
}
