import java.util.*;
import java.lang.Math;
public class quickstart {
static double SZ = 10.0;
static int INF = 1000000000;
static int IT = 100;
static int IT_UE = 100;
static double C_NS = 0.299792458;
int n;
double[][] bs;
double[][] ue;
double[][] t;
double[][] bs_best;
double[][] ue_best;
double[] toa;
private void readInput() {
Scanner in = new Scanner(System.in);
n = in .nextInt();
bs = new double[4][];
for (int i = 0; i < 4; ++i) {
bs[i] = new double[2];
}
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
bs[i][j] = in .nextDouble();
t = new double[n][];
for (int i = 0; i < n; ++i) {
t[i] = new double[4];
for (int j = 0; j < 4; ++j)
t[i][j] = in .nextDouble();
}
}
private void writeOutput() {
for (int i = 2; i < 4; ++i)
System.out.printf("%.9f %.9f\n", bs_best[i][0], bs_best[i][1]);
for (int i = 0; i < n; ++i)
System.out.printf("%.9f %.9f\n", ue_best[i][0], ue_best[i][1]);
}
public void solve() {
toa = new double[4];
Random rand = new Random();
double min_loss = INF;
bs_best = new double[4][];
for (int i = 0; i < 4; ++i) {
bs_best[i] = new double[2];
}
ue = new double[n][];
ue_best = new double[n][];
for (int i = 0; i < n; ++i) {
ue[i] = new double[2];
ue_best[i] = new double[2];
}
for (int i = 0; i < IT; ++i) {
bs[2][0] = -rand.nextDouble() * SZ;
bs[2][1] = rand.nextDouble() * SZ;
bs[3][0] = rand.nextDouble() * SZ;
bs[3][1] = rand.nextDouble() * SZ;
double loss_tdoa = 0;
for (int j = 0; j < n; ++j) {
double min_loss_ue = INF;
for (int k = 0; k < IT_UE; ++k) {
double ue_x = (rand.nextDouble() * 2 - 1) * SZ;
double ue_y = (rand.nextDouble() * 2 - 1) * SZ;
for (int l = 0; l < 4; ++l)
toa[l] = Math.sqrt((ue_x - bs[l][0]) * (ue_x - bs[l][0]) + (ue_y - bs[l][1]) * (ue_y - bs[l][1])) / C_NS;
double loss = 0;
for (int l = 1; l < 4; ++l)
loss += ((toa[l] - toa[0]) - (t[j][l] - t[j][0])) * ((toa[l] - toa[0]) - (t[j][l] - t[j][0]));
if (loss < min_loss_ue) {
min_loss_ue = loss;
ue[j][0] = ue_x;
ue[j][1] = ue_y;
}
}
loss_tdoa += min_loss_ue;
}
if (loss_tdoa < min_loss) {
min_loss = loss_tdoa;
for (int j = 0; j < 4; ++j) {
bs_best[j][0] = bs[j][0];
bs_best[j][1] = bs[j][1];
}
for (int j = 0; j < n; ++j) {
ue_best[j][0] = ue[j][0];
ue_best[j][1] = ue[j][1];
}
}
}
}
public static void main(String args[]) {
quickstart solver = new quickstart();
solver.readInput();
solver.solve();
solver.writeOutput();
}
}