0 0 10 10
1
10 0 0 1.57079
0
 -88 -68 -10 -61
5
-64 -55 3.09648 0.28346
-8 -52 2.46781 0.13262
-8 -59 3.02445 0.00119
-40 90 2.37292 0.15686
-29 -34 2.73957 0.18287
0
 0 0 10 10
2
10 0 0 1.57079
10 5 0 0.7854
1
 -100000 -100000 100000 100000
1
100000 0 0 15.70796
0
 -3 -7 -14 2
5
-16 19 2.12587 0.30781
9 -19 3.27418 0.06595
-1 12 0.12414 8.82294
20 10 6.25657 0.77605
-10 17 0.29502 6.31019
5

14.142079
 7.216642
 7.071084
 2828426.5363
 0.0000

#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
struct pnt {
  double x, y;
  pnt(double x = 0, double y = 0) : x(x), y(y) {}
  pnt operator+(pnt a) { return pnt(x + a.x, y + a.y); }
  pnt operator-(pnt a) { return pnt(x - a.x, y - a.y); }
  pnt operator/(double a) { return pnt(x / a, y / a); }
  pnt operator*(double a) { return pnt(x * a, y * a); }
  double operator^(pnt a) { return x * a.y - y * a.x; }
  double operator&(pnt a) { return x * a.x + y * a.y; }
  double dist() { return sqrt(x * x + y * y); }
  void input() { scanf("%lf %lf", &x, &y); }
  void print() { printf("%lf %lf\n", x, y); }
} pos, A, B;
double al[100010];
double a, w;
int n;
double angle(pnt b, pnt a, pnt c) {
  return acos((b - a & c - a) / (c - a).dist() / (b - a).dist());
}
int main() {
  A.input(), B.input();
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    pos.input(), scanf("%lf %lf", &a, &w);
    pnt tp = pnt(cos(a), sin(a));
    double ang = angle(pos + tp, pos, B);
    double t1 = ang / w;
    al[i] = t1;
  }
  int k;
  scanf("%d", &k);
  if (k == n)
    printf("%.12lf\n", 0.);
  else {
    printf("%.12lf\n", (A - B).dist() / al[k] + 1e-9);
  }
}
