← Home
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type Node struct {
	x, y                 int64
	left, right          int
	signLeft, signRight  int64
}

func distSq(x, y int64) int64 {
	return x*x + y*y
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1024*1024), 10*1024*1024)

	if !scanner.Scan() {
		return
	}
	n, _ := strconv.Atoi(scanner.Text())

	nodes := make([]Node, 0, 2*n)
	for i := 0; i < n; i++ {
		scanner.Scan()
		x, _ := strconv.ParseInt(scanner.Text(), 10, 64)
		scanner.Scan()
		y, _ := strconv.ParseInt(scanner.Text(), 10, 64)
		nodes = append(nodes, Node{
			x: x, y: y,
			left: -1, right: -1,
		})
	}

	active := make([]int, 0, 3)
	for i := 0; i < n; i++ {
		active = append(active, i)
		for len(active) == 3 {
			var a, b int
			var sign2 int64
			found := false
			for j := 0; j < 3 && !found; j++ {
				for k := j + 1; k < 3 && !found; k++ {
					v1 := nodes[active[j]]
					v2 := nodes[active[k]]
					if distSq(v1.x+v2.x, v1.y+v2.y) <= 1000000000000 {
						a, b = j, k
						sign2 = 1
						found = true
					} else if distSq(v1.x-v2.x, v1.y-v2.y) <= 1000000000000 {
						a, b = j, k
						sign2 = -1
						found = true
					}
				}
			}

			newNodeIdx := len(nodes)
			v1 := nodes[active[a]]
			v2 := nodes[active[b]]
			nodes = append(nodes, Node{
				x:         v1.x + sign2*v2.x,
				y:         v1.y + sign2*v2.y,
				left:      active[a],
				right:     active[b],
				signLeft:  1,
				signRight: sign2,
			})

			var remaining int
			for j := 0; j < 3; j++ {
				if j != a && j != b {
					remaining = active[j]
				}
			}
			active = []int{remaining, newNodeIdx}
		}
	}

	if len(active) == 2 {
		v1 := nodes[active[0]]
		v2 := nodes[active[1]]
		newNodeIdx := len(nodes)
		if distSq(v1.x+v2.x, v1.y+v2.y) <= distSq(v1.x-v2.x, v1.y-v2.y) {
			nodes = append(nodes, Node{
				left:      active[0],
				right:     active[1],
				signLeft:  1,
				signRight: 1,
			})
		} else {
			nodes = append(nodes, Node{
				left:      active[0],
				right:     active[1],
				signLeft:  1,
				signRight: -1,
			})
		}
		active = []int{newNodeIdx}
	}

	ans := make([]int, n)
	var dfs func(idx int, currentSign int64)
	dfs = func(idx int, currentSign int64) {
		if idx < n {
			ans[idx] = int(currentSign)
			return
		}
		dfs(nodes[idx].left, currentSign*nodes[idx].signLeft)
		dfs(nodes[idx].right, currentSign*nodes[idx].signRight)
	}

	dfs(active[0], 1)

	out := make([]string, n)
	for i, val := range ans {
		if val == 1 {
			out[i] = "1"
		} else {
			out[i] = "-1"
		}
	}
	fmt.Println(strings.Join(out, " "))
}