#!/bin/bash
cat <<'EOF' > a.cpp
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <random>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define whole(x) begin(x), end(x)
using namespace std;

int main() {
    // input
    int n; scanf("%d", &n);
    vector<int16_t> a(n), b(n), c(n);
    repeat (i, n) scanf("%hd%hd%hd", &a[i], &b[i], &c[i]);

    // solve
    constexpr double eps = 1e-6;

    // // find the windows
    default_random_engine gen;
    vector<double> samples_x;
    vector<double> samples_y;
    constexpr int sample_size = 100000;
    constexpr int window_radius = 1000;
    repeat (iteration, sample_size) {
        int i, j;
        do {
            i = uniform_int_distribution<int>(0, n - 1)(gen);
            j = uniform_int_distribution<int>(0, n - 1)(gen);
        } while (i == j);
        double den = a[i] * b[j] - a[j] * b[i];
        double x = (b[j] * c[i] - b[i] * c[j]) / den;
        double y = (a[j] * c[i] - a[i] * c[j]) / - den;
        samples_x.push_back(x);
        samples_y.push_back(y);
    }
    sort(whole(samples_x));
    sort(whole(samples_y));
    bool determined_x = samples_x[sample_size / 2 - window_radius] == samples_x[sample_size / 2 + window_radius];
    bool determined_y = samples_y[sample_size / 2 - window_radius] == samples_y[sample_size / 2 + window_radius];
    float lx = samples_x[sample_size / 2 - window_radius] - eps;
    float rx = samples_x[sample_size / 2 + window_radius] + eps;
    float ly = samples_y[sample_size / 2 - window_radius] - eps;
    float ry = samples_y[sample_size / 2 + window_radius] + eps;

    // // get poits in them
    int low_count_x = 0;
    int low_count_y = 0;
    vector<char> flag(n);
    vector<double> bucket_x;
    vector<double> bucket_y;
#pragma clang loop vectorize(enable)
    repeat (j, n) {
        {
            float aj = a[j];
            float bj = b[j];
            float cj = c[j];
#pragma clang loop vectorize(enable)
            repeat (i, j) {
                float den = a[i] * bj - aj * b[i];
                float x = (bj * c[i] - b[i] * cj) / den;
                float y = (aj * c[i] - a[i] * cj) / - den;
                low_count_x += (x < lx);
                low_count_y += (y < ly);
                flag[i] = (int(lx <= x and x <= rx) * 2) | int(ly <= y and y <= ry);
            }
        }
        {
            double aj = a[j];
            double bj = b[j];
            double cj = c[j];
            repeat (i, j) if (flag[i]) {
                double den = a[i] * bj - aj * b[i];
                if (flag[i] & 2) {
                    double x = (bj * c[i] - b[i] * cj) / den;
                    bucket_x.push_back(x);
                }
                if (flag[i] & 1) {
                    double y = (aj * c[i] - a[i] * cj) / - den;
                    bucket_y.push_back(y);
                }
            }
        }
    }

    // // make results
    int half = (n * (n - 1) / 2 - 1) / 2;
    double x;
    if (determined_x) {
        x = samples_x[sample_size / 2 - window_radius];
    } else {
        int ix = half - low_count_x;
        assert (0 <= ix and ix < bucket_x.size());
        nth_element(bucket_x.begin(), bucket_x.begin() + ix, bucket_x.end());
        x = bucket_x[ix];
    }
    double y;
    if (determined_y) {
        y = samples_y[sample_size / 2 - window_radius];
    } else {
        int iy = half - low_count_y;
        assert (0 <= iy and iy < bucket_y.size());
        nth_element(bucket_y.begin(), bucket_y.begin() + iy, bucket_y.end());
        y = bucket_y[iy];
    }

    // output
    printf("%.15lf %.15lf\n", x, y);
    return 0;
}

EOF
clang++ -std=c++14 -stdlib=libc++ -O3 -mtune=native -march=native a.cpp
exec ./a.out
