On the xy-plane, Snuke is going to travel from the point (x_s, y_s) to the point (x_t, y_t).
He can move in arbitrary directions with speed 1.
Here, we will consider him as a point without size.
There are N circular barriers deployed on the plane.
The center and the radius of the i-th barrier are (x_i, y_i) and r_i, respectively.
The barriers may overlap or contain each other.
A point on the plane is exposed to cosmic rays if the point is not within any of the barriers.
Snuke wants to avoid exposure to cosmic rays as much as possible during the travel.
Find the minimum possible duration of time he is exposed to cosmic rays during the travel.

-----Constraints-----
 - All input values are integers.
 - -10^9 ≤ x_s, y_s, x_t, y_t ≤ 10^9
 - (x_s, y_s) ≠ (x_t, y_t)
 - 1≤N≤1,000
 - -10^9 ≤ x_i, y_i ≤ 10^9
 - 1 ≤ r_i ≤ 10^9

-----Input-----
The input is given from Standard Input in the following format:
x_s y_s x_t y_t
N
x_1 y_1 r_1
x_2 y_2 r_2
:
x_N y_N r_N

-----Output-----
Print the minimum possible duration of time Snuke is exposed to cosmic rays during the travel.
The output is considered correct if the absolute or relative error is at most 10^{-9}.

-----Sample Input-----
-2 -2 2 2
1
0 0 1

-----Sample Output-----
3.6568542495

An optimal route is as follows:

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'def main():\n    import sys\n    input = sys.stdin.readline\n\n    INF = 10 ** 10\n\n    from math import sqrt\n\n    xs, ys, xg, yg = map(int, input().split())\n\n    N = int(input())\n    XYR = [tuple(map(int, input().split())) for _ in range(N)]\n\n    G = [[] for _ in range(N + 2)]\n\n    def diff1(i, j):\n        tmp = (XYR[i][0] - XYR[j][0]) ** 2 + (XYR[i][1] - XYR[j][1]) ** 2\n        R = XYR[i][2] + XYR[j][2]\n        return max(0, sqrt(tmp) - R)\n\n    for i in range(N - 1):\n        for j in range(i + 1, N):\n            tmp = diff1(i, j)\n            G[i].append((tmp, j))\n            G[j].append((tmp, i))\n\n    def diff2(x, y, i):\n        tmp = (x - XYR[i][0]) ** 2 + (y - XYR[i][1]) ** 2\n        R = XYR[i][2]\n        return max(0, sqrt(tmp) - R)\n\n    for i in range(N):\n        tmp = diff2(xs, ys, i)\n        G[N].append((tmp, i))\n        G[i].append((tmp, N))\n\n\n    for i in range(N):\n        tmp = diff2(xg, yg, i)\n        G[N + 1].append((tmp, i))\n        G[i].append((tmp, N + 1))\n\n    tmp = (xs - xg) ** 2 + (ys - yg) ** 2\n    G[N].append((sqrt(tmp), N + 1))\n    G[N + 1].append((sqrt(tmp), N))\n\n    d = [INF] * (N + 2) #頂点sからの距離\n\n    def dijksrea(s): #始点s\n        from heapq import heappop, heappush\n        d[s] = 0 #始点の距離を0にする\n        pque = []\n        heappush(pque, (0, s)) #要素を[距離、頂点]として管理\u3000最初の位置を入れる\n\n        while pque: #queの中に要素が残っている時\n            p = heappop(pque) #最も距離が短いものを取り出す\n            v = p[1] #距離が最も短い頂点\n            if d[v] < p[0]: #取り出した値より既に小さい値がdに入っているときは無視して次へ\n                continue\n            for i in range(len(G[v])): #頂点vの隣接リストを走査\n                e = G[v][i]\n                if d[e[1]] > d[v] + e[0]: #距離が更新できるかを検討\n                    d[e[1]] = d[v] + e[0]\n                    heappush(pque, (d[e[1]], e[1])) #更新できた場合、その値をpqueに入れる\n\n    dijksrea(N)\n    print (d[N + 1])\n\n    # print (d)\n\ndef __starting_point():\n    main()\n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 15053