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;
pair<double, double> operator-(const pair<double, double>& lhs,
                               const pair<double, double>& rhs) {
  return pair<double, double>(lhs.first - rhs.first, lhs.second - rhs.second);
}
pair<double, double> operator+(const pair<double, double>& lhs,
                               const pair<double, double>& rhs) {
  return pair<double, double>(lhs.first + rhs.first, lhs.second + rhs.second);
}
pair<double, double> operator*(double t, pair<double, double> p) {
  return pair<double, double>(t * p.first, t * p.second);
}
pair<double, double> operator/(pair<double, double> p, double t) {
  return pair<double, double>(p.first / t, p.second / t);
}
pair<double, double> rot(pair<double, double> p) {
  return pair<double, double>(-p.second, p.first);
}
double Cross(const pair<double, double>& lhs, const pair<double, double>& rhs) {
  return lhs.first * rhs.second - lhs.second * rhs.first;
}
double Dot(const pair<double, double>& lhs, const pair<double, double>& rhs) {
  return lhs.first * rhs.first + lhs.second * rhs.second;
}
double Dist2(const pair<double, double>& lhs, const pair<double, double>& rhs) {
  return Dot(lhs - rhs, lhs - rhs);
}
bool onSegment(pair<double, double> a, pair<double, double> b,
               pair<double, double> c) {
  pair<double, double> v = c - a;
  pair<double, double> w = b - a;
  return Cross(v, w) == 0 && 0 <= Dot(v, w) && Dot(v, w) <= Dot(v, v);
}
bool Intersects(pair<double, double> s0, pair<double, double> e0,
                pair<double, double> s1, pair<double, double> e1) {
  pair<double, double> a = s1 - s0;
  pair<double, double> v = e0 - s0;
  pair<double, double> w = s1 - e1;
  double det = Cross(v, w);
  double t0 = w.second * a.first - w.first * a.second;
  double t1 = -v.second * a.first + v.first * a.second;
  if (det < 0) {
    if (det <= t0 && det <= t1 && t0 <= 0 && t1 <= 0) {
      return true;
    }
  } else if (det > 0) {
    if (0 <= t0 && 0 <= t1 && t0 <= det && t1 <= det) {
      return true;
    }
  }
  return onSegment(s0, s1, e0) || onSegment(s0, e1, e0) ||
         onSegment(s1, s0, e1) || onSegment(s1, e0, e1);
}
bool IntersectLineParam(pair<double, double> s0, pair<double, double> e0,
                        pair<double, double> s1, pair<double, double> e1,
                        double& t0, double& t1) {
  pair<double, double> a = s1 - s0;
  pair<double, double> v = e0 - s0;
  pair<double, double> w = s1 - e1;
  double det = Cross(v, w);
  if (det == 0) {
    return false;
  }
  t0 = Cross(a, w) / det;
  t1 = Cross(v, a) / det;
  return true;
}
pair<double, double> Interpolate(pair<double, double> s, pair<double, double> e,
                                 double t) {
  return (1 - t) * s + t * e;
}
bool IntersectLine(pair<double, double> s0, pair<double, double> e0,
                   pair<double, double> s1, pair<double, double> e1,
                   pair<double, double>& result) {
  double t0, t1;
  if (IntersectLineParam(s0, e0, s1, e1, t0, t1)) {
    result = Interpolate(s0, e0, t0);
    return true;
  }
  return false;
}
bool Intersects(vector<pair<double, double> >& lhs,
                vector<pair<double, double> >& rhs) {
  for (int i = 1; i < lhs.size(); i++) {
    for (int j = 1; j < rhs.size(); j++) {
      if (Intersects(lhs[i], lhs[i - 1], rhs[j], rhs[j - 1])) {
        return true;
      }
    }
  }
  return false;
}
bool IsInside(vector<pair<double, double> >& ps, pair<double, double> p) {
  int count = 0;
  for (int i = 0; i < ps.size(); i++) {
    pair<double, double> a = ps[i];
    pair<double, double> b = ps[(i + 1) % ps.size()];
    if (min(a.first, b.first) <= p.first && p.first < max(a.first, b.first)) {
      double c = Cross(p - a, b - a);
      if (c == 0) {
        return true;
      }
      if (c < 0) {
        count--;
      } else {
        count++;
      }
    } else if (a.first == p.first && b.first == p.first) {
      if (min(a.second, b.second) <= p.second &&
          p.second <= max(a.second, b.second)) {
        return true;
      }
    }
  }
  return count != 0;
}
double area(vector<pair<double, double> > ps) {
  double sum = 0;
  for (int i = 0; i < ps.size(); i++) {
    sum += Cross(ps[i], ps[(i + 1) % ps.size()]);
  }
  return abs(sum) / 2;
}
array<double, 3> Cross(array<double, 3> a, array<double, 3> b) {
  return {{a[1] * b[2] - b[1] * a[2], a[2] * b[0] - b[2] * a[0],
           a[0] * b[1] - b[0] * a[1]}};
}
double Dot(array<double, 3> a, array<double, 3> b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}
const pair<double, double> M(1e50, 1e50);
pair<double, double> Min(pair<double, double> a, pair<double, double> b) {
  double v = abs(a.first) + abs(b.first);
  if (v == 0 || abs(a.first - b.first) < v * 1e-9) {
    return pair<double, double>((a.first + b.first) / 2,
                                min(a.second, b.second));
  }
  return min(a, b);
}
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<double, double> > ps;
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    ps.push_back(pair<double, double>(x, y));
  }
  pair<double, double> a;
  array<double, 3> W;
  array<double, 3> F = {{}};
  array<double, 3> U;
  scanf("%lf%lf", &a.first, &a.second);
  for (int i = 0; i < n; i++) {
    ps[i] = ps[i] - a;
  }
  scanf("%lf%lf%lf", &W[0], &W[1], &W[2]);
  scanf("%lf", &F[2]);
  scanf("%lf%lf%lf", &U[0], &U[1], &U[2]);
  pair<double, double> v = pair<double, double>(W[0], W[1]);
  pair<double, double> u = pair<double, double>(-U[2] * W[0] + W[2] * U[0],
                                                -U[2] * W[1] + W[2] * U[1]);
  double cuv = Cross(u, v);
  pair<double, double> ret = M;
  double lv = Dot(v, v);
  double lu = Dot(u, u);
  if (cuv == 0) {
    auto f = [&](pair<double, double> p) {
      double d = Dot(p, p);
      if (lv > 0 && Dot(p, v) > 0) {
        ret = Min(ret, pair<double, double>(sqrt(d / lv),
                                            -sqrt(d / lv) * W[2] / F[2]));
      }
      if (lu > 0 && Dot(p, u) > 0) {
        ret = Min(ret, pair<double, double>(-sqrt(d / lu) * U[2], 0));
      }
    };
    for (int i = 0; i < n; i++) {
      if (Cross(v, ps[i]) == 0 && Dot(v, ps[i]) > 0) {
        f(ps[i]);
      }
      if (Cross(u, ps[i]) == 0 && Dot(u, ps[i]) > 0) {
        f(ps[i]);
      }
      double t0, t1;
      if (IntersectLineParam(pair<double, double>(0, 0), v, ps[i],
                             ps[(i + 1) % n], t0, t1)) {
        if (0 <= t1 && t1 <= 1 & 0 < t0) {
          f(Interpolate(ps[i], ps[(i + 1) % n], t1));
        }
      }
      if (IntersectLineParam(pair<double, double>(0, 0), u, ps[i],
                             ps[(i + 1) % n], t0, t1)) {
        if (0 <= t1 && t1 <= 1 && 0 < t0) {
          f(Interpolate(ps[i], ps[(i + 1) % n], t1));
        }
      }
    }
  } else {
    cerr << "bbb" << endl;
    array<double, 3> c0 = Cross(F, U);
    pair<double, double> p0 = pair<double, double>(c0[0], c0[1]);
    array<double, 3> c1 = Cross(U, W);
    pair<double, double> p1 = pair<double, double>(c1[0], c1[1]);
    double det = Dot(W, c0);
    auto f = [&](pair<double, double> p) {
      ret = Min(ret, pair<double, double>(Dot(p0, p) / det, Dot(p1, p) / det));
    };
    for (int i = 0; i < n; i++) {
      if (Cross(u, ps[i]) * cuv >= 0 && Cross(ps[i], v) * cuv >= 0) {
        f(ps[i]);
      }
      double t0, t1;
      if (IntersectLineParam(pair<double, double>(0, 0), v, ps[i],
                             ps[(i + 1) % n], t0, t1)) {
        if (0 <= t1 && t1 <= 1 && 0 < t0) {
          f(Interpolate(ps[i], ps[(i + 1) % n], t1));
        }
      }
      if (IntersectLineParam(pair<double, double>(0, 0), u, ps[i],
                             ps[(i + 1) % n], t0, t1)) {
        if (0 <= t1 && t1 <= 1 && 0 < t0) {
          f(Interpolate(ps[i], ps[(i + 1) % n], t1));
        }
      }
    }
  }
  if (ret == M) {
    ret = pair<double, double>(-1, -1);
  }
  printf("%.17lf %.17lf\n", ret.first, ret.second);
  return 0;
}