#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const int MAX = 300;
const long double eps = 1e-13;
const long double eps2 = 1e-11;
int n;
int m;
int x1, y8687969, z1, x2, y2, z2, f, x[10001], y[10001];
int vect(int x1, int y8687969, int x2, int y2) {
  return x1 * y2 - x2 * y8687969;
}
int scal(int x1, int y8687969, int x2, int y2) {
  return x1 * x2 + y8687969 * y2;
}
int _in(long long xx, long long yy) {
  long long sum = 0, rl = 0;
  for (int i = 0; i < n; i++) {
    sum += abs((x[i] - xx) * (y[i + 1] - yy) - (x[i + 1] - xx) * (y[i] - yy));
    rl += x[i] * y[i + 1] - x[i + 1] * y[i];
  }
  if (sum != abs(rl)) return 0;
  return 1;
}
int _in2(long double xx, long double yy) {
  long double sum = 0, rl = 0;
  for (int i = 0; i < n; i++) {
    sum += fabs((x[i] - xx) * (y[i + 1] - yy) - (x[i + 1] - xx) * (y[i] - yy));
    rl += x[i] * y[i + 1] - x[i + 1] * y[i];
  }
  if (fabs(sum - abs(rl)) > eps) return 0;
  return 1;
}
int cross(long long x1, long long y8687969, long long x2, long long y2,
          long long x3, long long y3, long long x4, long long y4,
          long double *t, int r1, int r2) {
  long long a = x2 - x1;
  long long b = x3 - x4;
  long long c = x3 - x1;
  long long d = y2 - y8687969;
  long long e = y3 - y4;
  long long f = y3 - y8687969;
  if (a * e - b * d != 0) {
    long long Q = (a * e - b * d);
    long long T = (c * e - b * f);
    long long S = (a * f - c * d);
    if (Q < 0) {
      T = -T;
      S = -S;
      Q = -Q;
    }
    int ok = 1;
    if (r1 & 1) ok &= int(T >= 0);
    if (r1 & 2) ok &= int(T <= Q);
    if (r2 & 1) ok &= int(S >= 0);
    if (r2 & 2) ok &= int(S <= Q);
    if (ok) {
      *t = (long double)T / Q;
      return 1;
    }
  }
  return 0;
}
int cross2(long double x1, long double y8687969, long double x2, long double y2,
           long double x3, long double y3, long double x4, long double y4,
           long double *t, int r1, int r2) {
  long double a = x2 - x1;
  long double b = x3 - x4;
  long double c = x3 - x1;
  long double d = y2 - y8687969;
  long double e = y3 - y4;
  long double f = y3 - y8687969;
  if (a * e - b * d != 0) {
    long double Q = (a * e - b * d);
    long double T = (c * e - b * f);
    long double S = (a * f - c * d);
    if (Q < 0) {
      T = -T;
      S = -S;
      Q = -Q;
    }
    int ok = 1;
    if (r1 & 1) ok &= int(T > -eps * Q);
    if (r1 & 2) ok &= int(T < Q * (1 + eps));
    if (r2 & 1) ok &= int(S > -eps * Q);
    if (r2 & 2) ok &= int(S < Q * (1 + eps));
    if (ok) {
      *t = (long double)T / Q;
      return 1;
    }
  }
  return 0;
}
int check(long long x1, long long y8687969, long long x2, long long y2,
          long double *t, int r1, int r2) {
  if (_in(x1, y8687969)) {
    *t = 0;
    return 1;
  }
  int ok = 0;
  long double nt;
  *t = 1e20;
  for (int i = 0; i < n; i++)
    if (cross(x1, y8687969, x2, y2, x[i], y[i], x[i + 1], y[i + 1], &nt, r1,
              r2)) {
      *t = min(*t, nt);
      ok = 1;
    }
  return ok;
}
int check2(long double x1, long double y8687969, long double x2, long double y2,
           long double *t, int r1, int r2) {
  if (_in2(x1, y8687969)) {
    *t = 0;
    return 1;
  }
  int ok = 0;
  long double nt;
  *t = 1e20;
  for (int i = 0; i < n; i++)
    if (cross2(x1, y8687969, x2, y2, x[i], y[i], x[i + 1], y[i + 1], &nt, r1,
               r2)) {
      *t = min(*t, nt);
      ok = 1;
    }
  return ok;
}
int check3(long double x1, long double y8687969, long double x2, long double y2,
           int i) {
  return int((x[i] - x1) * (x[i] - x2) + (y[i] - y8687969) * (y[i] - y2) < eps);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &x[i], &y[i]);
  int X, Y;
  scanf("%d%d", &X, &Y);
  for (int i = 0; i < n; i++) {
    x[i] -= X;
    y[i] -= Y;
  }
  x[n] = x[0];
  y[n] = y[0];
  scanf("%d%d%d", &x1, &y8687969, &z1);
  scanf("%d", &f);
  f = -f;
  scanf("%d%d%d", &x2, &y2, &z2);
  z2 = -z2;
  int x3 = x1 * z2 + x2 * z1, y3 = y8687969 * z2 + y2 * z1;
  long double t1 = 1e20, t2 = 1e20, t, tt;
  if (check(0, 0, x1, y8687969, &t, 1, 3)) {
    check2(x1 * t + x2 * ((z1 * t) / z2), y8687969 * t + y2 * ((z1 * t) / z2),
           x1 * t, y8687969 * t, &tt, 3, 3);
    tt *= ((z1 * t) / f);
    if (t1 > t + eps || fabs(t - t1) < eps && t2 > tt + eps) {
      t1 = t;
      t2 = tt;
    }
  }
  if (check(0, 0, x3, y3, &t, 1, 3)) {
    t *= z2;
    check2(x1 * t + x2 * ((z1 * t) / z2), y8687969 * t + y2 * ((z1 * t) / z2),
           x1 * t, y8687969 * t, &tt, 3, 3);
    tt *= ((z1 * t) / f);
    if (t1 > t + eps || fabs(t - t1) < eps && t2 > tt + eps) {
      t1 = t;
      t2 = tt;
    }
  }
  if (vect(x1, y8687969, x2, y2) != 0) {
    long double T = 1e20, r;
    for (int i = 0; i < n; i++)
      if (cross(0, 0, x1, y8687969, x[i], y[i], x[i] - x2 * z1, y[i] - y2 * z1,
                &r, 1, 1))
        T = min(T, r);
    if (T < 5e19) {
      long double t = T, tt;
      if (check2(x1 * T + x2 * ((z1 * T) / z2),
                 y8687969 * T + y2 * ((z1 * T) / z2), x1 * T, y8687969 * T, &tt,
                 3, 3)) {
        tt *= ((z1 * T) / f);
        if (t1 > t + eps || fabs(t - t1) < eps && t2 > tt + eps) {
          t1 = t;
          t2 = tt;
        }
      }
    }
  }
  if (t1 > 5e19)
    printf("-1 -1\n");
  else
    printf("%.15f %.15f\n", (double)t1, (double)t2);
  return 0;
}
