#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 100;
struct Node {
  long long x, y;
  int l, r;
  Node() {}
  Node(long long xx, long long yy) {
    x = xx;
    y = yy;
  }
  double length() { return sqrt(x * x + y * y); }
  long long mult(const Node &n) { return x * n.x + y * n.y; }
  Node operator-() { return Node(-x, -y); }
};
long long operator*(const Node &a, const Node &b) {
  return a.x * b.y - a.y * b.x;
}
Node operator-(const Node &a, const Node &b) {
  return Node(a.x - b.x, a.y - b.y);
}
int n, cnt;
int ans[maxn], the_Index[3];
Node node[maxn];
bool Close(Node &a, Node &b) {
  if (a.mult(b) < 0) {
    return false;
  }
  long long tmp = abs(a * b);
  return tmp <= a.length() * b.length() / 2 * sqrt(3.0);
}
int Creat_Node(const Node &n, int l, int r) {
  ++cnt;
  node[cnt] = n;
  node[cnt].l = l;
  node[cnt].r = r;
  return cnt;
}
void Solve() {
  sort(the_Index, the_Index + 3);
  do {
    int l = the_Index[0];
    int r = the_Index[1];
    Node tmp = node[l];
    Node ntmp = node[r];
    if (Close(tmp, ntmp)) {
      ans[l] = 1;
      ans[r] = -1;
      int Index = Creat_Node(tmp - ntmp, l, r);
      ans[Index] = 1;
      the_Index[0] = Index;
      the_Index[1] = the_Index[2];
      return;
    }
    ntmp = -node[r];
    if (Close(tmp, ntmp)) {
      ans[l] = ans[r] = 1;
      int Index = Creat_Node(tmp - ntmp, l, r);
      ans[Index] = 1;
      the_Index[0] = Index;
      the_Index[1] = the_Index[2];
      return;
    }
  } while (next_permutation(the_Index, the_Index + 3));
}
int main() {
  ios::sync_with_stdio(false);
  while (scanf("%d", &n) != EOF) {
    cnt = 0;
    for (int i = 1; i <= n; ++i) {
      scanf("%I64d%I64d", &node[i].x, &node[i].y);
      node[i].l = node[i].r = 0;
      ++cnt;
    }
    if (n == 1) {
      printf("1\n");
      continue;
    }
    ans[1] = 1;
    the_Index[0] = 1;
    the_Index[1] = 2;
    for (int i = 3; i <= n; ++i) {
      the_Index[2] = i;
      Solve();
    }
    int l = the_Index[0];
    int r = the_Index[1];
    if (node[l].mult(node[r]) >= 0) {
      ans[r] = -1;
    } else {
      ans[r] = 1;
    }
    for (int i = cnt; i >= 1; --i) {
      ans[node[i].l] *= ans[i];
      ans[node[i].r] *= ans[i];
    }
    for (int i = 1; i <= n; ++i) {
      if (i != 1) {
        printf(" ");
      }
      printf("%d", ans[i]);
    }
    printf("\n");
  }
  return 0;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

For a vector \vec{v} = (x, y), define |v| = √{x^2 + y^2}.

Allen had a bit too much to drink at the bar, which is at the origin. There are n vectors \vec{v_1}, \vec{v_2}, ⋅⋅⋅, \vec{v_n}. Allen will make n moves. As Allen's sense of direction is impaired, during the i-th move he will either move in the direction \vec{v_i} or -\vec{v_i}. In other words, if his position is currently p = (x, y), he will either move to p + \vec{v_i} or p - \vec{v_i}.

Allen doesn't want to wander too far from home (which happens to also be the bar). You need to help him figure out a sequence of moves (a sequence of signs for the vectors) such that his final position p satisfies |p| ≤ 1.5 ⋅ 10^6 so that he can stay safe.

Input

The first line contains a single integer n (1 ≤ n ≤ 10^5) — the number of moves.

Each of the following lines contains two space-separated integers x_i and y_i, meaning that \vec{v_i} = (x_i, y_i). We have that |v_i| ≤ 10^6 for all i.

Output

Output a single line containing n integers c_1, c_2, ⋅⋅⋅, c_n, each of which is either 1 or -1. Your solution is correct if the value of p = ∑_{i = 1}^n c_i \vec{v_i}, satisfies |p| ≤ 1.5 ⋅ 10^6.

It can be shown that a solution always exists under the given constraints.

Examples

Input

3
999999 0
0 999999
999999 0


Output

1 1 -1 


Input

1
-824590 246031


Output

1 


Input

8
-67761 603277
640586 -396671
46147 -122580
569609 -2112
400 914208
131792 309779
-850150 -486293
5272 721899


Output

1 1 1 1 1 1 1 -1 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 100;
struct Node {
  long long x, y;
  int l, r;
  Node() {}
  Node(long long xx, long long yy) {
    x = xx;
    y = yy;
  }
  double length() { return sqrt(x * x + y * y); }
  long long mult(const Node &n) { return x * n.x + y * n.y; }
  Node operator-() { return Node(-x, -y); }
};
long long operator*(const Node &a, const Node &b) {
  return a.x * b.y - a.y * b.x;
}
Node operator-(const Node &a, const Node &b) {
  return Node(a.x - b.x, a.y - b.y);
}
int n, cnt;
int ans[maxn], the_Index[3];
Node node[maxn];
bool Close(Node &a, Node &b) {
  if (a.mult(b) < 0) {
    return false;
  }
  long long tmp = abs(a * b);
  return tmp <= a.length() * b.length() / 2 * sqrt(3.0);
}
int Creat_Node(const Node &n, int l, int r) {
  ++cnt;
  node[cnt] = n;
  node[cnt].l = l;
  node[cnt].r = r;
  return cnt;
}
void Solve() {
  sort(the_Index, the_Index + 3);
  do {
    int l = the_Index[0];
    int r = the_Index[1];
    Node tmp = node[l];
    Node ntmp = node[r];
    if (Close(tmp, ntmp)) {
      ans[l] = 1;
      ans[r] = -1;
      int Index = Creat_Node(tmp - ntmp, l, r);
      ans[Index] = 1;
      the_Index[0] = Index;
      the_Index[1] = the_Index[2];
      return;
    }
    ntmp = -node[r];
    if (Close(tmp, ntmp)) {
      ans[l] = ans[r] = 1;
      int Index = Creat_Node(tmp - ntmp, l, r);
      ans[Index] = 1;
      the_Index[0] = Index;
      the_Index[1] = the_Index[2];
      return;
    }
  } while (next_permutation(the_Index, the_Index + 3));
}
int main() {
  ios::sync_with_stdio(false);
  while (scanf("%d", &n) != EOF) {
    cnt = 0;
    for (int i = 1; i <= n; ++i) {
      scanf("%I64d%I64d", &node[i].x, &node[i].y);
      node[i].l = node[i].r = 0;
      ++cnt;
    }
    if (n == 1) {
      printf("1\n");
      continue;
    }
    ans[1] = 1;
    the_Index[0] = 1;
    the_Index[1] = 2;
    for (int i = 3; i <= n; ++i) {
      the_Index[2] = i;
      Solve();
    }
    int l = the_Index[0];
    int r = the_Index[1];
    if (node[l].mult(node[r]) >= 0) {
      ans[r] = -1;
    } else {
      ans[r] = 1;
    }
    for (int i = cnt; i >= 1; --i) {
      ans[node[i].l] *= ans[i];
      ans[node[i].r] *= ans[i];
    }
    for (int i = 1; i <= n; ++i) {
      if (i != 1) {
        printf(" ");
      }
      printf("%d", ans[i]);
    }
    printf("\n");
  }
  return 0;
}

```