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>
#pragma comment(linker, "/STACK:836777216")
using namespace std;
int n;
int x[11111];
int y[11111];
int xa, ya, xv, yv, zv, f, xu, yu, zu;
const double eps = 1e-7;
double t1 = -1, t2 = -1;
const double SM_INF = 1e10;
struct SimplexM {
  int startN, N;
  vector<long double> old_c, c, b, res;
  vector<vector<long double> > system;
  double value;
  SimplexM(vector<long double> c) : N(c.size()), c(c) {}
  void add(vector<long double> r, double v, int sgn = 0) {
    for (; c.size() < r.size(); c.push_back(0))
      ;
    for (; r.size() < c.size(); r.push_back(0))
      ;
    if (sgn) r.push_back(-sgn), c.push_back(0);
    system.push_back(r), b.push_back(v);
  }
  void refresh_c_func(int pos, int row) {
    double begin = c[pos];
    for (int i(0); i < (N); i++) c[i] -= begin * system[row][i];
  }
  void gauss(int row, int col) {
    double v = system[row][col];
    for (int i(0); i < (N); i++) system[row][i] /= v;
    b[row] /= v;
    for (int i(0); i < (system.size()); i++)
      if (i != row) {
        v = system[i][col];
        for (int j(0); j < (N); j++) system[i][j] -= v * system[row][j];
        b[i] -= v * b[row];
      }
  }
  int solve() {
    N = c.size(), old_c = c;
    int m = system.size();
    for (int i(0); i < (m); i++) system[i].resize(N);
    startN = N;
    vector<int> base(m, -1);
    for (int i(0); i < (N); i++) {
      int nm = 0, pos = -1;
      for (int j(0); j < (m); j++)
        if (fabs(system[j][i]) > eps) nm++, pos = j;
      if (nm == 1 && fabs(system[pos][i] - 1) < eps && base[pos] == -1)
        base[pos] = i;
    }
    for (int i(0); i < (m); i++)
      if (base[i] == -1) {
        N++;
        c.push_back(SM_INF);
        for (int j(0); j < (m); j++) system[j].push_back(j == i ? 1 : 0);
        base[i] = N - 1;
      }
    for (int i(0); i < (m); i++) refresh_c_func(base[i], i);
    while (1) {
      int pos = -1, row = -1;
      for (int i(0); i < (N); i++)
        if (c[i] < -eps && (pos == -1 || c[i] < c[pos])) pos = i;
      if (pos == -1) break;
      double min_teta = 0;
      for (int i(0); i < (m); i++)
        if (system[i][pos] > eps &&
            (row == -1 || min_teta > b[i] / system[i][pos]))
          row = i, min_teta = b[i] / system[i][pos];
      if (row == -1) return -1;
      base[row] = pos;
      gauss(row, pos);
      refresh_c_func(pos, row);
    }
    for (int i(0); i < (m); i++)
      if (base[i] >= startN && fabs(b[i]) > eps) return -2;
    res.resize(startN, 0);
    for (int i(0); i < (m); i++)
      if (base[i] < startN) res[base[i]] = b[i];
    value = 0;
    for (int i(0); i < (startN); i++) value += res[i] * old_c[i];
    return 1;
  }
};
void go(double X, double Y) {
  vector<long double> c;
  c.push_back(1e5);
  c.push_back(1);
  c.push_back(0);
  SimplexM m(c);
  vector<long double> r1;
  r1.push_back(xv);
  r1.push_back(0);
  r1.push_back(xu);
  if (X < 0) {
    X = -X;
    for (int i(0); i < (r1.size()); i++) r1[i] = -r1[i];
  }
  m.add(r1, X, 0);
  vector<long double> r2;
  r2.push_back(yv);
  r2.push_back(0);
  r2.push_back(yu);
  if (Y < 0) {
    Y = -Y;
    for (int i(0); i < (r2.size()); i++) r2[i] = -r2[i];
  }
  m.add(r2, Y, 0);
  vector<long double> r3;
  r3.push_back(zv);
  r3.push_back(f);
  r3.push_back(zu);
  m.add(r3, 0, 0);
  if (m.solve() == 1) {
    double T1 = m.res[0];
    double T2 = m.res[1];
    if (t1 < -0.5 || t1 > T1 + eps || t1 > T1 - eps && t2 > T2 + eps)
      t1 = T1, t2 = T2;
  }
}
double det(double a, double b, double c, double d) { return a * d - b * c; }
int main() {
  cin >> n;
  for (int i(0); i < (n); i++) scanf("%d %d", x + i, y + i);
  x[n] = x[0], y[n] = y[0];
  cin >> xa >> ya;
  for (int i(0); i < (n + 1); i++) x[i] -= xa, y[i] -= ya;
  cin >> xv >> yv >> zv;
  cin >> f;
  cin >> xu >> yu >> zu;
  for (int i(0); i < (n); i++) go(x[i], y[i]);
  double dx = xv;
  double dy = yv;
  for (int q(0); q < (2); q++) {
    for (int i(0); i < (n); i++) {
      double d = det(x[i + 1] - x[i], -dx, y[i + 1] - y[i], -dy);
      if (fabs(d) > eps) {
        double t1 = det(-x[i], -dx, -y[i], -dy) / d;
        double t2 = det(x[i + 1] - x[i], -x[i], y[i + 1] - y[i], -y[i]) / d;
        if (t1 > 0 && t1 < 1 && t2 > 0) {
          go(dx * t2, dy * t2);
        }
      }
    }
    dx += zv / double(-zu) * xu;
    dy += zv / double(-zu) * yu;
  }
  printf("%.6lf %.6lf\n", t1, t2);
  return 0;
}