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;
vector<pair<double, double> > ls;
pair<double, double> p[100000];
int n;
pair<double, double> p0;
double vx, vy, vz, ux, uy, uz, Fd, anst1, anst2;
const double eps = 1e-10;
pair<double, double> operator+(pair<double, double> a, pair<double, double> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
pair<double, double> operator-(pair<double, double> a, pair<double, double> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
double operator*(pair<double, double> a, pair<double, double> b) {
  return a.first * b.first + a.second * b.second;
}
double operator/(pair<double, double> a, pair<double, double> b) {
  return a.first * b.second - a.second * b.first;
}
pair<pair<double, double>, double> make_l(pair<double, double> a,
                                          pair<double, double> b) {
  pair<pair<double, double>, double> ll;
  ll.first.first = (b - a).second;
  ll.first.second = (a - b).first;
  ll.second = -(ll.first.first * a.first + ll.first.second * a.second);
  return ll;
}
void make_p(pair<pair<double, double>, double> a,
            pair<pair<double, double>, double> b, pair<double, double> p1,
            pair<double, double> p2) {
  double dd = a.first.first * b.first.second - a.first.second * b.first.first;
  if (abs(dd) > eps) {
    double dx = a.second * b.first.second - a.first.second * b.second;
    double dy = a.first.first * b.second - a.second * b.first.first;
    pair<double, double> p0 = make_pair(-dx / dd, -dy / dd);
    if ((abs((p1 - p0) / (p2 - p0)) < eps) && ((p0 - p1) * (p2 - p1) >= -eps) &&
        ((p0 - p2) * (p1 - p2) >= -eps))
      ls.push_back(p0);
  }
}
pair<pair<double, double>, double> solve(vector<vector<double> > a) {
  int n = a.size();
  int m = a[0].size() - 1;
  vector<int> ws(n, 0);
  vector<int> pr(m, -1);
  vector<double> gg(m, 0);
  for (int k = 0; k < n; k++) {
    int mnx = -1;
    int mny = -1;
    for (int i = 0; i < n; i++)
      if (ws[i] == 0) {
        for (int j = 0; j < m; j++)
          if (abs(a[i][j]) > eps) {
            mnx = i;
            mny = j;
          }
      }
    if (mnx == -1) break;
    double ff = a[mnx][mny];
    ws[mnx] = 1;
    for (int i = 0; i <= m; i++) {
      a[mnx][i] /= ff;
    }
    pr[mny] = mnx;
    for (int i = 0; i < n; i++)
      if (i != mnx) {
        ff = a[i][mny];
        for (int j = 0; j <= m; j++) {
          a[i][j] -= ff * a[mnx][j];
        }
      }
  }
  for (int i = 0; i < n; i++)
    if (ws[i] == 0) {
      if (abs(a[i][m]) > eps) {
        return make_pair(make_pair(-1, -1), -1);
      }
    }
  for (int i = 0; i < m; i++)
    if (pr[i] == -1)
      gg[i] = 0;
    else {
      gg[i] = a[pr[i]][m];
    }
  for (int i = 0; i < m; i++)
    if (gg[i] < -eps) {
      return make_pair(make_pair(-1, -1), -1);
    }
  return make_pair(make_pair(gg[0], gg[1]), gg[2]);
}
void try_solve(pair<double, double> p1) {
  vector<vector<double> > mt;
  vector<double> vv;
  vv.push_back(vx);
  vv.push_back(0);
  vv.push_back(ux);
  vv.push_back(p1.first - p0.first);
  mt.push_back(vv);
  vv.clear();
  vv.push_back(vy);
  vv.push_back(0);
  vv.push_back(uy);
  vv.push_back(p1.second - p0.second);
  mt.push_back(vv);
  vv.clear();
  vv.push_back(vz);
  vv.push_back(Fd);
  vv.push_back(uz);
  vv.push_back(0);
  mt.push_back(vv);
  pair<pair<double, double>, double> ans = solve(mt);
  if (ans.first.first >= -eps) {
    if (ans.first.first <= anst1 + eps) {
      if ((ans.first.first < anst1 - eps) ||
          (ans.first.second <= anst2 + eps)) {
        anst1 = ans.first.first;
        anst2 = ans.first.second;
      }
    }
  }
  vv.clear();
  vv.push_back(0);
  vv.push_back(1);
  vv.push_back(0);
  vv.push_back(0);
  mt.push_back(vv);
  ans = solve(mt);
  if (ans.first.first >= -eps) {
    if (ans.first.first <= anst1 + eps) {
      if ((ans.first.first < anst1 - eps) ||
          (ans.first.second <= anst2 + eps)) {
        anst1 = ans.first.first;
        anst2 = ans.first.second;
      }
    }
  }
  mt[3][1] = 0;
  mt[3][2] = 1;
  ans = solve(mt);
  if (ans.first.first >= -eps) {
    if (ans.first.first <= anst1 + eps) {
      if ((ans.first.first < anst1 - eps) ||
          (ans.first.second <= anst2 + eps)) {
        anst1 = ans.first.first;
        anst2 = ans.first.second;
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf%lf", &p[i].first, &p[i].second);
    ls.push_back(p[i]);
  }
  p[n] = p[0];
  scanf("%lf%lf", &p0.first, &p0.second);
  scanf("%lf%lf%lf%lf%lf%lf%lf", &vx, &vy, &vz, &Fd, &ux, &uy, &uz);
  if (vx * vx + vy * vy > eps) {
    for (int i = 0; i < n; i++)
      make_p(make_l(p0, p0 + make_pair(vx, vy)), make_l(p[i], p[i + 1]), p[i],
             p[i + 1]);
  }
  double tt = -vz / uz;
  double vvx = vx + tt * ux;
  double vvy = vy + tt * uy;
  if (vvx * vvx + vvy * vvy > eps) {
    for (int i = 0; i < n; i++)
      make_p(make_l(p0, p0 + make_pair(vvx, vvy)), make_l(p[i], p[i + 1]), p[i],
             p[i + 1]);
  }
  anst1 = 1e100;
  anst2 = 1e100;
  try_solve(ls[1]);
  for (int i = 0; i < ls.size(); i++) {
    try_solve(ls[i]);
  }
  cout.precision(15);
  if (anst1 > 1e99)
    cout << "-1 -1 " << endl;
  else
    cout << fixed << anst1 << " " << anst2 << endl;
}