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

public class convex_md_wrong implements Runnable {
	class Point implements Comparable<Point> {
		int x, y;
		
		public Point(int x, int y) {
			this.x = x;
			this.y = y;
		}

		public int compareTo(Point o) {
			if (x == o.x)
				return y - o.y;
			return x - o.x;
		}
		
		@Override
		public boolean equals(Object obj) {
			if (obj instanceof Point) {
			    Point point = (Point) obj;
			    return (x == point.x) && (y == point.y);
			}
			return false;
		}
		
		@Override
		public String toString() {
			return x + " " + y;
		}

		public Point shift(Ray r) {
			return new Point(x + r.dx, y + r.dy);
		}
	}
	
	class Ray {
		Point v, u;
		int dx, dy, dir;
		
		public Ray(Point v, Point u) {
			this.v = v;
			this.u = u;
			dx = u.x - v.x;
			dy = u.y - v.y;
			dir = 3 * Integer.signum(dx) + Integer.signum(dy);
		}

		public int relativePosition(Ray r) {
			int v = dx * r.dy - dy * r.dx;
			if (v != 0)
				return Integer.signum(v);
			return (dir == r.dir) ? 0 : 2;
		}
	}
	
	private Scanner in;
	private PrintWriter out;

	public void run() {
		try {
			solve();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public static int orientation(Point a, Point b, Point c) {
		long area = a.x * (long) b.y - b.x * (long) a.y +
					b.x * (long) c.y - c.x * (long) b.y +
					c.x * (long) a.y - a.x * (long) c.y;
		return Long.signum(area);
	}
	
	public static Point[] convexHull(Collection<Point> points) {
		int n = points.size();
		Point[] p = points.toArray(new Point[n]);
		Arrays.sort(p);
		if (p[0].equals(p[n - 1])) {
			return new Point[]{p[0]};
		}
		ArrayList<Point> x = new ArrayList<Point>();
		for (int i = 0; i < 2 * n; i++) {
			int j;
			if (i < n) {
				j = i;
			} else {
				j = 2 * n - 1 - i;
				int o = orientation(p[0], p[n - 1], p[j]);
				if (o >= 0)
					continue;
			}
			x.add(p[j]);
			while (true) {
				if (x.size() < 3)
					break;
				int o = orientation(x.get(x.size() - 3), x.get(x.size() - 2), x.get(x.size() - 1));
				if (o < 0)
					break;
				x.remove(x.size() - 2);
			}
		}
		return x.toArray(new Point[x.size()]);
	}

	private void solve() throws IOException {
		Locale.setDefault(Locale.US);
		in = new Scanner(new FileReader("convex.in"));
		out = new PrintWriter("convex.out");
		int n = in.nextInt();
		ArrayList<Ray> rays = new ArrayList<Ray>();
		ArrayList<Point> points = new ArrayList<Point>();
		for (int i = 0; i < n; i++) {
			Point p = readPoint();
			Point a = readPoint();
			Point b = readPoint();
			points.add(p);
			rays.add(new Ray(p, a));
			rays.add(new Ray(p, b));
		}
		in.close();
		Ray z = rays.get(0);
		Ray min = z;
		Ray max = z;
		for (Ray r : rays) {
			int rel = z.relativePosition(r);
			if (rel == 2) {
				max = r;
				continue;
			}
			if (rel == 0)
				continue;
			if (rel == 1) {
				if (max.relativePosition(r) == 1) {
					max = r;
				}
				continue;
			}
			if (min.relativePosition(r) == -1) {
				min = r;
			}
		}
		int rel = min.relativePosition(max);
		if (rel == -1) {
			out.println(0);
			out.close();
			return;
		}
		Point[] ch = convexHull(points);
		int i0 = find(ch, min.dx, min.dy, 1);
		if (rel == 2) {
			out.println(1);
			out.println("line " + ch[i0] + " " + ch[i0].shift(max));
			out.close();
			return;
		}
		int i1 = find(ch, max.dx, max.dy, -1);
		int l = i1 - i0;
		if (l < 0)
			l += ch.length;
		out.println(l + 2);
		out.println("inray " + ch[i0].shift(min) + " " + ch[i0]);
		for (int i = i0; i != i1; i = (i + 1) % ch.length) {
			out.println("segment " + ch[i] + " " + ch[(i + 1) % ch.length]);
		}
		out.println("outray " + ch[i1] + " " + ch[i1].shift(max));
		out.close();
	}

	private int find(Point[] p, int dx, int dy, int mult) {
		int res = 0;
		int cb = (dy * p[0].x - dx * p[0].y) * mult;
		int db = dx * p[0].x + dy * p[0].y;
		for (int i = 1; i < p.length; i++) {
			int ci = (dy * p[i].x - dx * p[i].y) * mult;
			int di = dx * p[i].x + dy * p[i].y;
			if ((ci > cb) || (ci == cb && di < db)) {
				res = i;
				cb = ci;
				db = di;
			}
		}
		return res;
	}

	private Point readPoint() {
		int x = in.nextInt();
		int y = in.nextInt();
		return new Point(x, y);
	}

	public static void main(String[] args) {
		new Thread(new convex_md_wrong()).start();
	}
}
