#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
inline int sig(double a) { return (a > eps) - (a < -eps); }
using CP = const struct P&;
struct P {
  double x, y;
  P() : P(0, 0) {}
  P(double x, double y) : x(x), y(y) {}
  void read() { scanf("%lf%lf", &x, &y); }
  void log() { printf("%g %g\n", x, y); }
  P operator+(CP b) const { return P(x + b.x, y + b.y); }
  P operator-(CP b) const { return P(x - b.x, y - b.y); }
  P operator*(double a) const { return P(a * x, a * y); }
  P operator/(double a) const { return P(x / a, y / a); }
  P to(CP a) const { return a - *this; }
  P from(CP a) const { return *this - a; }
  double operator*(CP b) const { return x * b.x + y * b.y; }
  double operator%(CP b) const { return x * b.y - y * b.x; }
  double dot(CP a, CP b) const { return to(a) * to(b); }
  double cross(CP a, CP b) const { return to(a) % to(b); }
  double len() const { return hypot(x, y); }
  P proj(CP a, CP b) const {
    return a + (b - a) / (b - a).len() * a.dot(*this, b);
  }
  P mirror(CP a, CP b) const { return *this + to(proj(a, b)) * 2; }
  bool on_seg(CP a, CP b) const {
    return !sig(cross(a, b)) && sig(dot(a, b)) <= 0;
  }
};
int cut(CP a, CP b, CP c, CP d) {
  if (a.on_seg(c, d) || b.on_seg(c, d) || c.on_seg(a, b) || d.on_seg(a, b))
    return 0;
  return sig(a.cross(b, c) * a.cross(b, d)) < 0 &&
                 sig(c.cross(d, a) * c.cross(d, b)) < 0
             ? 1
             : -1;
}
int contain(P a[], int n, P p) {
  P o(cos(0.123143215) * 1e5, sin(0.5436543645) * 1e5);
  int count = 0;
  for (int i = 0; i < n; ++i) {
    if (p.on_seg(a[i], a[i + 1])) return 0;
    count += cut(o, p, a[i], a[i + 1]) > 0;
  }
  return count % 2 ? 1 : -1;
}
const int N = 11111;
int n;
P a[N], s, v1, v3;
double z1, z2, z3;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    a[i].read();
  }
  a[n] = a[0];
  s.read();
  v1.read();
  scanf("%lf%lf", &z1, &z2);
  v3.read();
  scanf("%lf", &z3);
  bool zero3 = !sig(v3.x) && !sig(v3.y);
  double l = 0, r = 1e5;
  while (r - l > 1e-9) {
    double m = (l + r) * .5;
    P s1 = s + v1 * m;
    P s2 = s1 + v3 * (z1 * m / -z3);
    P sa[4] = {s, s1, s2, s};
    bool ok = !zero3 && contain(sa, 3, a[0]) >= 0;
    if (!ok)
      for (int i = 0; i < n; ++i)
        if (cut(s, s1, a[i], a[i + 1]) >= 0 ||
            cut(s2, s, a[i], a[i + 1]) >= 0 ||
            !zero3 && cut(s1, s2, a[i], a[i + 1]) >= 0) {
          ok = true;
          break;
        }
    if (ok)
      r = m;
    else
      l = m;
  }
  if (l > 5e4) {
    puts("-1 -1");
    return 0;
  }
  double t1 = r;
  double t2 = 0;
  double t3 = (z1 * t1 + z2 * t2) / -z3;
  P s1 = s + v1 * t1;
  P s2 = s1 + v3 * t3;
  if (contain(a, n, s2) >= 0) {
    printf("%.12lf 0\n", t1);
    return 0;
  }
  l = 0;
  r = 1e5;
  while (r - l > 1e-8) {
    double m = (l + r) * .5;
    t3 = (z1 * t1 + m * z2) / -z3;
    P p = s1 + v3 * t3;
    bool ok = false;
    for (int i = 0; i < n; ++i)
      if (cut(p, s2, a[i], a[i + 1]) >= 0) {
        ok = true;
        break;
      }
    if (ok)
      r = m;
    else
      l = m;
  }
  t2 = r;
  printf("%.12lf %.12lf\n", t1, t2);
}
