import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class convex_dg_wrong {

	public static void main(String[] args) {
		new Thread(){
			public void run() {
				try {
					new convex_dg_wrong().run();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}.start();
	}
	
	class Point implements Comparable<Point> {
		long x, y, r;
		double a;
		
		public int compareTo(Point p) {
			if (a > p.a) {
				return 1;
			}
			if (a < p.a) {
				return -1;
			}
			if (r > p.r) {
				return 1;
			}
			if (r < p.r) {
				return -1;
			}
			return 0;
		}
	}
	
	final int maxN = 1000;
	final int maxC = 10000;

	protected void run() throws IOException {
		Scanner in = new Scanner(new File("convex.in"));
		PrintWriter out = new PrintWriter("convex.out");
		
		int n = in.nextInt();
		assert n >= 1 && n <= maxN : "Wrong n";
		
		long[] cx = new long[n];
		long[] cy = new long[n];
		long[][] x = new long[n][2];
		long[][] y = new long[n][2];
		for (int i = 0; i < n; i++) {
			cx[i] = in.nextInt();
			cy[i] = in.nextInt();
			assert Math.abs(cx[i]) <= maxC && Math.abs(cy[i]) <= maxC : "Angle " + (i + 1) + " has wrong coordinates";
			x[i][0] = in.nextInt();
			y[i][0] = in.nextInt();
			assert Math.abs(x[i][0]) <= maxC && Math.abs(y[i][0]) <= maxC : "Angle " + (i + 1) + " has wrong coordinates";
			x[i][1] = in.nextInt();
			y[i][1] = in.nextInt();
			assert Math.abs(x[i][1]) <= maxC && Math.abs(y[i][1]) <= maxC : "Angle " + (i + 1) + " has wrong coordinates";
			
			if (vect(cx[i] - x[i][0], cy[i] - y[i][0], x[i][1] - cx[i], y[i][1] - cy[i]) > 0) {
				long t = x[i][0]; x[i][0] = x[i][1]; x[i][1] = t;
				t = y[i][0]; y[i][0] = y[i][1]; y[i][1] = t;
			}
		}
		
		in.close();

		boolean plane = true;
		boolean line = false;
		long linex1 = 0;
		long liney1 = 0;
		long linex2 = 0;
		long liney2 = 0;
		
		first:
		for (int i = 0; i < n; i++) {
			for (int p = 0; p < 2; p++) {
				long a = y[i][p] - cy[i];
				long b = cx[i] - x[i][p];
				long c = -(a * x[i][p] + b * y[i][p]);
				
				long val = a * x[i][1 - p] + b * y[i][1 - p] + c;
				boolean ok = true;
				
				second:
				for (int j = 0; j < n; j++) {
					for (int q = 0; q < 2; q++) {
						long u = a * cx[j] + b * cy[j] + c;
						long v = a * (cx[j] + (x[j][q] - cx[j]) * 100000) + b * (cy[j] + (y[j][q] - cy[j]) * 100000) + c;
						if (u > 0 && val < 0 || u < 0 && val > 0) {
							ok = false;
							break second;
						}
						if (v > 0 && val < 0 || v < 0 && val > 0) {
							ok = false;
							break second;
						}
						
						if (u == 0 && v == 0 && scalar(cx[i] - x[i][p], cy[i] - y[i][p], cx[j] - x[j][q], cy[j] - y[j][q]) < 0) {
							line = true;
						}
					}
				}
				
				if (ok) {
					plane = false;
					if (p == 0) {
						linex1 = x[i][0];
						liney1 = y[i][0];
						linex2 = cx[i];
						liney2 = cy[i];
					} else {
						linex1 = cx[i];
						liney1 = cy[i];
						linex2 = x[i][1];
						liney2 = y[i][1];
					}
					break first;
				} else {
					line = false;
				}
			}
		}
		
		if (plane) {
			out.println(0);
			out.close();
			return;
		}
		
		if (line) {
			out.println(1);
			out.println("line " + linex1 + " " + liney1 + " " + linex2 + " " + liney2);
			out.close();
			return;
		}
		
		Point[] conv = getConv(n, cx, cy);
		if (conv.length > 1) {
			boolean pos = false;
			for (int i = 0; i < n; i++) {
				for (int p = 0; p < 2; p++) {
					if (vect(conv[1].x - conv[0].x, conv[1].y - conv[0].y, x[i][p] - conv[1].x, y[i][p] - conv[1].y) > 0) {
						pos = true;
					}
				}
			}
			if (pos) {
				for (int i = 0; i < conv.length / 2; i++) {
					Point p = conv[i];
					conv[i] = conv[conv.length - 1 - i];
					conv[conv.length - 1 - i] = p;
				}
			}
		}
		
		double best = 100;
		int besti = -1;
		int bestj = -1;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				int p = 0;
				int q = 1;
				double cos = scalar(x[i][p] - cx[i], y[i][p] - cy[i], x[j][q] - cx[j], y[j][q] - cy[j]) / 
					Math.hypot(x[i][p] - cx[i], y[i][p] - cy[i]) / Math.hypot(x[j][q] - cx[j], y[j][q] - cy[j]);
				if (cos < best) {
					best = cos;
					besti = i;
					bestj = j;
				}
			}
		}
		long sx = x[besti][0] - cx[besti];
		long sy = y[besti][0] - cy[besti];
		long ex = x[bestj][1] - cx[bestj];
		long ey = y[bestj][1] - cy[bestj];
		
		int si = 0;
		for (si = 0; si < conv.length; si++) {
			int pr = si - 1;
			if (pr < 0) {
				pr = conv.length - 1;
			}
			int ne = si + 1;
			if (ne == conv.length) {
				ne = 0;
			}
			
			if (vect(conv[si].x - conv[pr].x, conv[si].y - conv[pr].y, -sx, -sy) <= 0 &&
					vect(conv[ne].x - conv[si].x, conv[ne].y - conv[si].y, -sx, -sy) > 0) {
				break;
			}
		}
		if (si == conv.length && conv.length > 1) {
			assert false : "Bug in program";
		}
		if (conv.length == 1) {
			si = 0;
		}
		
		int sj = 0;
		for (sj = 0; sj < conv.length; sj++) {
			int pr = sj - 1;
			if (pr < 0) {
				pr = conv.length - 1;
			}
			int ne = sj + 1;
			if (ne == conv.length) {
				ne = 0;
			}
			
			if (vect(conv[sj].x - conv[pr].x, conv[sj].y - conv[pr].y, ex, ey) <= 0 &&
					vect(conv[ne].x - conv[sj].x, conv[ne].y - conv[sj].y, ex, ey) > 0) {
				break;
			}
		}
		if (sj == conv.length && conv.length > 1) {
			assert false : "Bug in program";
		}
		if (conv.length == 1) {
			sj = 0;
		}
		
		Point[] res = new Point[n];
		int resc = 0;
		int i = si;
		while (true) {
			res[resc++] = conv[i];
			if (i == sj) {
				break;
			}
			i = (i + 1) % conv.length;
		}
		
		out.println(resc + 1);
		out.println("inray " + (res[0].x + sx) + " " + (res[0].y + sy) + " " + res[0].x + " " + res[0].y);
		for (i = 0; i < resc - 1; i++) {
			out.println("segment " + res[i].x + " " + res[i].y + " " + res[i + 1].x + " " + res[i + 1].y);
		}
		out.println("outray " + res[resc - 1].x + " " + res[resc - 1].y + " " + (res[resc - 1].x + ex) + " " + (res[resc - 1].y + ey));
		
		out.close();
	}

	private Point[] getConv(int m, long[] cx, long[] cy) {
		Point[] p = new Point[m];
		int n = 0;
		first:
		for (int i = 0; i < m; i++) {
			for (int j = 0; j < i; j++) {
				if (cx[i] == cx[j] && cy[i] == cy[j]) {
					continue first;
				}
			}
			n++;
			p[n - 1] = new Point();
			p[n - 1].x = cx[i];
			p[n - 1].y = cy[i];
		}
		
		if (n <= 2) {
			Point[] q = new Point[n];
			for (int i = 0; i < n; i++) {
				q[i] = p[i];
			}
			return q;
		}
		
		for (int i = 1; i < n; i++) {
			if (p[i].x < p[0].x || (p[i].x == p[0].x && p[i].y < p[0].y)) {
				Point q = p[i];
				p[i] = p[0];
				p[0] = q;
			}
		}
		for (int i = 1; i < n; i++) {
			p[i].a = Math.atan2(p[i].y - p[0].y, p[i].x - p[0].x);
			p[i].r = (p[i].y - p[0].y) * (p[i].y - p[0].y) + (p[i].x - p[0].x) * (p[i].x - p[0].x);
		}
		Arrays.sort(p, 1, n);
		Point[] st = new Point[n];
		int sc = 2;
		st[0] = p[0];
		st[1] = p[1];
		for (int i = 2; i < n; i++) {
			while (sc > 1 && vect(st[sc - 1].x - st[sc - 2].x, st[sc - 1].y - st[sc - 2].y, p[i].x - st[sc - 1].x, p[i].y - st[sc - 1].y) <= 0) {
				sc--;
			}
			st[sc++] = p[i];
		}
		p = new Point[sc];
		for (int i = 0; i < sc; i++) {
			p[i] = st[i];
		}
		
		return p;
	}

	private long scalar(long x1, long y1, long x2, long y2) {
		return x1 * x2 + y1 * y2;
	}

	private long vect(long x1, long y1, long x2, long y2) {
		return x1 * y2 - x2 * y1;
	}

}
