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-8;
struct P {
  double x, y;
  P() {}
  P(double _x, double _y) : x(_x), y(_y) {}
  P operator+(const P& a) const { return P(x + a.x, y + a.y); }
  P operator-(const P& a) const { return P(x - a.x, y - a.y); }
  P operator*(const double& a) const { return P(x * a, y * a); }
  P operator/(const double& a) const { return P(x / a, y / a); }
  bool operator==(const P& a) const { return (*this - a).abs() < eps; }
  bool operator!=(const P& a) const { return !(*this == a); }
  bool operator<(const P& a) const {
    return x < a.x - eps || fabs(a.x - x) < eps && y < a.y;
  }
  double abs() { return sqrt(x * x + y * y); }
  void get() { scanf("%lf%lf", &x, &y); }
  void out() { printf("%.9lf %.9lf\n", x, y); }
};
bool equ(double a, double b) { return fabs(a - b) < eps; }
P med(P a, P b, P c) {
  if (a < b)
    if (b < c)
      return b;
    else if (a < c)
      return c;
    else
      return a;
  else if (a < c)
    return a;
  else if (b < c)
    return c;
  else
    return b;
}
P a[10010], u, v, p, S(1e20, 1e20);
double uz, vz, fz;
int n;
void geti(P a, P b, P c, P d, vector<P>& e) {
  double A = b.y - a.y, B = a.x - b.x, C = A * a.x + B * a.y;
  double D = d.y - c.y, E = c.x - d.x, F = D * c.x + E * c.y;
  if (equ(A * E, B * D)) return;
  P p((C * E - F * B) / (A * E - D * B), (C * D - F * A) / (B * D - E * A));
  if (med(a, b, p) != p || med(c, d, p) != d && med(c, d, p) != p) return;
  e.push_back(p);
}
P ff(P a) {
  double t1 = ((a.x - p.x) * v.y - (a.y - p.y) * v.x) / (u.x * v.y - u.y * v.x),
         t3 = ((a.x - p.x) * u.y - (a.y - p.y) * u.x) / (v.x * u.y - v.y * u.x),
         t2 = (t1 * uz - t3 * vz) / fz;
  if (t1 < -eps || t2 < -eps || t3 < -eps) return P(1e20, 1e20);
  if (t1 < 0) t1 = 0;
  if (t2 < 0) t2 = 0;
  if (t3 < 0) t3 = 0;
  return P(t1, t2);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) a[i].get();
  p.get(), u.get(), scanf("%lf", &uz), scanf("%lf", &fz),
      fz = -fz, v.get(), scanf("%lf", &vz), vz = -vz;
  if (u.abs() < eps)
    if (v.abs() < eps)
      ;
    else {
      vector<P> e;
      for (int i = 0; i < n; i++) geti(a[i], a[(i + 1) % n], p, p + v, e);
      sort(e.begin(), e.end()), e.erase(unique(e.begin(), e.end()), e.end());
      for (int i = 0; i < (int)e.size(); i++)
        S = min(S, P((e[i] - p).abs() / v.abs() * vz / uz, 0));
    }
  else if (v.abs() < eps) {
    vector<P> e;
    for (int i = 0; i < n; i++) geti(a[i], a[(i + 1) % n], p, p + u, e);
    sort(e.begin(), e.end()), e.erase(unique(e.begin(), e.end()), e.end());
    for (int i = 0; i < (int)e.size(); i++)
      S = min(S, P((e[i] - p).abs() / u.abs(), 0));
  } else if (equ(u.x * v.y, v.x * u.y)) {
    vector<P> e, f;
    for (int i = 0; i < n; i++) geti(a[i], a[(i + 1) % n], p, p + u, e);
    for (int i = 0; i < n; i++) geti(a[i], a[(i + 1) % n], p, p + v, f);
    sort(e.begin(), e.end()), e.erase(unique(e.begin(), e.end()), e.end()),
        sort(f.begin(), f.end()), f.erase(unique(f.begin(), f.end()), f.end());
    if (u / u.abs() == v / v.abs()) {
      for (int i = 0; i < (int)e.size(); i++)
        S = min(S, P((e[i] - p).abs() / (u.abs() + v.abs() * uz / vz), 0));
    } else if ((u / uz).abs() > (v / vz).abs() - eps) {
      for (int i = 0; i < (int)e.size(); i++)
        S = min(S, P((e[i] - p).abs() / u.abs(),
                     (e[i] - p).abs() / u.abs() * uz / fz));
    } else {
      for (int i = 0; i < (int)e.size(); i++)
        S = min(S, P((e[i] - p).abs() / u.abs(),
                     (e[i] - p).abs() / u.abs() * uz / fz));
      for (int i = 0; i < (int)f.size(); i++)
        S = min(S, P((f[i] - p).abs() / (v.abs() * uz / vz - u.abs()), 0));
    }
  } else {
    vector<P> e;
    for (int i = 0; i < n; i++)
      geti(a[i], a[(i + 1) % n], p, p + u, e),
          geti(a[i], a[(i + 1) % n], p, p + u + v * uz / vz, e),
          e.push_back(a[i]);
    sort(e.begin(), e.end()), e.erase(unique(e.begin(), e.end()), e.end());
    for (int i = 0; i < (int)e.size(); i++) S = min(S, ff(e[i]));
  }
  if (S.x > 1e10)
    puts("-1 -1");
  else
    S.out();
  return 0;
}