Problem: How horrible! The empire of galactic chickens tries to conquer a beautiful city «Z», they have built a huge incubator that produces millions of chicken soldiers a day, and fenced it around. The huge incubator looks like a poligon on the the plane Oxy with n vertices. Naturally, DravDe can't keep still, he wants to destroy the chicken empire. For sure, he will start with the incubator.

DravDe is strictly outside the incubator's territory in point A(xa, ya), and wants to get inside and kill all the chickens working there. But it takes a lot of doing! The problem is that recently DravDe went roller skating and has broken both his legs. He will get to the incubator's territory in his jet airplane LEVAP-41.

LEVAP-41 flies at speed V(xv, yv, zv). DravDe can get on the plane in point A, fly for some time, and then air drop himself. DravDe is very heavy, that's why he falls vertically at speed Fdown, but in each point of his free fall DravDe can open his parachute, and from that moment he starts to fall at the wind speed U(xu, yu, zu) until he lands. Unfortunately, DravDe isn't good at mathematics. Would you help poor world's saviour find such an air dropping plan, that allows him to land on the incubator's territory? If the answer is not unique, DravDe wants to find the plan with the minimum time of his flight on the plane. If the answers are still multiple, he wants to find the one with the minimum time of his free fall before opening his parachute

Input

The first line contains number n (3 ≤ n ≤ 104) — amount of vertices of the fence. Then there follow n lines containing the coordinates of these vertices (two integer numbers xi, yi) in clockwise or counter-clockwise order. It's guaranteed, that the fence does not contain self-intersections.

The following four lines contain coordinates of point A(xa, ya), speeds V(xv, yv, zv), Fdown and speed U(xu, yu, zu). All the input numbers are integer. All the coordinates don't exceed 104 in absolute value. It's guaranteed, that zv > 0 and Fdown, zu < 0, and point A is strictly outside the incubator's territory.

Output

In the first line output two numbers t1, t2 such, that if DravDe air drops at time t1 (counting from the beginning of the flight), he lands on the incubator's territory (landing on the border is regarder as landing on the territory). If DravDe doesn't open his parachute, the second number should be equal to the duration of DravDe's falling down. If it's impossible for DravDe to get to the incubator's territory, output -1 -1. If the answer is not unique, output the answer with the minimum t1. If the answers are still multiple, output the answer with the minimum t2. Your answer must have an absolute or relative error less than 10 - 6.

Examples

Input

4
0 0
1 0
1 1
0 1
0 -1
1 0 1
-1
0 1 -1


Output

1.00000000 0.00000000


Input

4
0 0
0 1
1 1
1 0
0 -1
-1 -1 1
-1
0 1 -1


Output

-1.00000000 -1.00000000


Input

4
0 0
1 0
1 1
0 1
0 -1
1 1 1
-1
1 1 -1


Output

0.50000000 0.00000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
inline int sig(double a) { return (a > eps) - (a < -eps); }
using CP = const struct P&;
struct P {
  double x, y;
  P() : P(0, 0) {}
  P(double x, double y) : x(x), y(y) {}
  void read() { scanf("%lf%lf", &x, &y); }
  void log() { printf("%g %g\n", x, y); }
  P operator+(CP b) const { return P(x + b.x, y + b.y); }
  P operator-(CP b) const { return P(x - b.x, y - b.y); }
  P operator*(double a) const { return P(a * x, a * y); }
  P operator/(double a) const { return P(x / a, y / a); }
  P to(CP a) const { return a - *this; }
  P from(CP a) const { return *this - a; }
  double operator*(CP b) const { return x * b.x + y * b.y; }
  double operator%(CP b) const { return x * b.y - y * b.x; }
  double dot(CP a, CP b) const { return to(a) * to(b); }
  double cross(CP a, CP b) const { return to(a) % to(b); }
  double len() const { return hypot(x, y); }
  P proj(CP a, CP b) const {
    return a + (b - a) / (b - a).len() * a.dot(*this, b);
  }
  P mirror(CP a, CP b) const { return *this + to(proj(a, b)) * 2; }
  bool on_seg(CP a, CP b) const {
    return !sig(cross(a, b)) && sig(dot(a, b)) <= 0;
  }
};
int cut(CP a, CP b, CP c, CP d) {
  if (a.on_seg(c, d) || b.on_seg(c, d) || c.on_seg(a, b) || d.on_seg(a, b))
    return 0;
  return sig(a.cross(b, c) * a.cross(b, d)) < 0 &&
                 sig(c.cross(d, a) * c.cross(d, b)) < 0
             ? 1
             : -1;
}
int contain(P a[], int n, P p) {
  P o(cos(0.123143215) * 1e5, sin(0.5436543645) * 1e5);
  int count = 0;
  for (int i = 0; i < n; ++i) {
    if (p.on_seg(a[i], a[i + 1])) return 0;
    count += cut(o, p, a[i], a[i + 1]) > 0;
  }
  return count % 2 ? 1 : -1;
}
const int N = 11111;
int n;
P a[N], s, v1, v3;
double z1, z2, z3;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    a[i].read();
  }
  a[n] = a[0];
  s.read();
  v1.read();
  scanf("%lf%lf", &z1, &z2);
  v3.read();
  scanf("%lf", &z3);
  bool zero3 = !sig(v3.x) && !sig(v3.y);
  double l = 0, r = 1e5;
  while (r - l > 1e-9) {
    double m = (l + r) * .5;
    P s1 = s + v1 * m;
    P s2 = s1 + v3 * (z1 * m / -z3);
    P sa[4] = {s, s1, s2, s};
    bool ok = !zero3 && contain(sa, 3, a[0]) >= 0;
    if (!ok)
      for (int i = 0; i < n; ++i)
        if (cut(s, s1, a[i], a[i + 1]) >= 0 ||
            cut(s2, s, a[i], a[i + 1]) >= 0 ||
            !zero3 && cut(s1, s2, a[i], a[i + 1]) >= 0) {
          ok = true;
          break;
        }
    if (ok)
      r = m;
    else
      l = m;
  }
  if (l > 5e4) {
    puts("-1 -1");
    return 0;
  }
  double t1 = r;
  double t2 = 0;
  double t3 = (z1 * t1 + z2 * t2) / -z3;
  P s1 = s + v1 * t1;
  P s2 = s1 + v3 * t3;
  if (contain(a, n, s2) >= 0) {
    printf("%.12lf 0\n", t1);
    return 0;
  }
  l = 0;
  r = 1e5;
  while (r - l > 1e-8) {
    double m = (l + r) * .5;
    t3 = (z1 * t1 + m * z2) / -z3;
    P p = s1 + v3 * t3;
    bool ok = false;
    for (int i = 0; i < n; ++i)
      if (cut(p, s2, a[i], a[i + 1]) >= 0) {
        ok = true;
        break;
      }
    if (ok)
      r = m;
    else
      l = m;
  }
  t2 = r;
  printf("%.12lf %.12lf\n", t1, t2);
}