← Home
package main

import (
	"fmt"
	"sort"
)

type Point struct {
	x, y int
}

func main() {
	var pts [3]Point
	for i := 0; i < 3; i++ {
		fmt.Scan(&pts[i].x, &pts[i].y)
	}

	sort.Slice(pts[:], func(i, j int) bool {
		return pts[i].x < pts[j].x
	})

	yVals := []int{pts[0].y, pts[1].y, pts[2].y}
	sort.Ints(yVals)
	yMed := yVals[1]

	type Seg struct {
		x1, y1, x2, y2 int
	}
	var segs []Seg

	if pts[0].x != pts[2].x {
		segs = append(segs, Seg{pts[0].x, yMed, pts[2].x, yMed})
	}

	for i := 0; i < 3; i++ {
		if pts[i].y != yMed {
			segs = append(segs, Seg{pts[i].x, pts[i].y, pts[i].x, yMed})
		}
	}

	fmt.Println(len(segs))
	for _, s := range segs {
		fmt.Printf("%d %d %d %d\n", s.x1, s.y1, s.x2, s.y2)
	}
}