import java.io.*;
import java.util.*;

public class greatwall_mb_vizi implements Visualizer {
    private static class Segment {
        private final int x1, y1, x2, y2;
        public Segment(int x1, int y1, int x2, int y2) {
            if (x1 > x2 || x1 == x2 && y1 > y2) {
                this.x1 = x2;
                this.y1 = y2;
                this.x2 = x1;
                this.y2 = y1;
            } else {
                this.x1 = x1;
                this.y1 = y1;
                this.x2 = x2;
                this.y2 = y2;
            }
        }
        public int hashCode() {
            int rv = 117;
            rv = 31 * rv + x1;
            rv = 31 * rv + y1;
            rv = 31 * rv + x2;
            rv = 31 * rv + y2;
            return rv;
        }
        public boolean equals(Object o) {
            if (o instanceof Segment) {
                Segment s = (Segment) o;
                return x1 == s.x1 && y1 == s.y1 && x2 == s.x2 && y2 == s.y2;
            } else {
                return false;
            }
        }
    }

    private static void myAssert(String msg, boolean exp) {
        if (!exp) {
            throw new AssertionError(msg);
        }
    }

    public void parseTest(Scanner in, Graphics out) {
        int m = in.nextInt();
        Set<Segment> set = new HashSet<Segment>();
        int[] x = new int[3];
        int[] y = new int[3];
        Set<Segment> all = new HashSet<Segment>();
        for (int line = 0; line < m; ++line) {
            for (int i = 0; i < 3; ++i) {
                x[i] = in.nextInt();
                y[i] = in.nextInt();
            }
            for (int i = 0; i < 3; ++i) {
                int j = (i + 1) % 3;
                Segment s = new Segment(x[i], y[i], x[j], y[j]);
                if (set.contains(s)) {
                    set.remove(s);
                } else {
                    set.add(s);
                }
                all.add(s);
            }
        }
        all.removeAll(set);
        for (Segment s : all) {
            out.putLine(new double[] {s.x1, s.x2}, new double[] {s.y1, s.y2}, false, false);
        }
        for (Segment s : set) {
            out.putLine(new double[] {s.x1, s.x2}, new double[] {s.y1, s.y2}, false, false, java.awt.Color.BLUE);
        }
    }
}
