#!/usr/bin/env python3
'''
'''

import matplotlib.pyplot as plt
from matplotlib.patches import Circle
import sys

#circle3 = plt.Circle((1, 1), 0.2, color='g', clip_on=False)
Circles = [Circle((x, y), r, color="DarkSeaGreen") for x, y ,r in eval(input())]
X, Y = eval(input())

fig, ax = plt.subplots()
#ax.add_artist(plt.Circle((x,y), r, color='DarkSeaGreen'))
for c in Circles:
    ax.add_patch(c)
x, y, fig = None, None, []
for s in sys.stdin:
    if (x,y) == eval(s):
        ax.plot([X, x], [Y, y], color="red")
    else:
        x, y = eval(s)
        ax.plot([X, x], [Y, y], color="grey", linewidth=0.3)
plt.plot(X, Y, "bo")
        

plt.show()
