Problem: There are N lines in the xy-plane. The i-th line is represented by A_ix+B_iy=C_i. Any two lines among the N+2 lines, the above N lines plus the x-axis and y-axis, cross each other at exactly one point.

For each pair 1 \leq i < j \leq N, there is a car at the cross point of the i-th and j-th lines. Even where three or more lines intersect at a point, a car is individually placed for each pair of lines. That is, there will be k(k-1)/2 cars placed at the intersection of k lines.

Those cars are already very old, and can only be moved parallel to the x-axis or y-axis.

Takahashi will hold an exhibition of antique cars at a place on the xy-plane. In order to avoid damaging the half-broken cars too much, he will select the place of the exhibition so that the total distance covered will be minimized when all the cars are moved to the place. If such a place is not uniquely determined, among the places that satisfy the condition above, the place with the minimum x-coordinate will be selected. If the place is still not uniquely determined, among the places that satisfy the two conditions above, the place with the minimum y-coordinate will be selected.

Find the place of the exhibition that will be selected.

Constraints

* 2 \leq N \leq 4 × 10^4
* 1 \leq |A_i|,|B_i| \leq 10^4(1 \leq i \leq N)
* 0 \leq |C_i| \leq 10^4(1 \leq i \leq N)
* No two given lines are parallel.
* All input values are integers.

Inputs

Input is given from Standard Input in the following format:


N
A_1 B_1 C_1
:
A_N B_N C_N


Outputs

Print the x-coordinate and y-coordinate of the place of the exhibition that will be selected, in this order, with a space in between. The output will be judged as correct when the absolute or relative error is at most 10^{-9}.

Examples

Input

3
1 1 1
2 -1 2
-1 2 2


Output

1.000000000000000 1.000000000000000


Input

4
1 1 2
1 -1 0
3 -1 -2
1 -3 4


Output

-1.000000000000000 -1.000000000000000


Input

7
1 7 8
-2 4 9
3 -8 -5
9 2 -14
6 7 5
-8 -9 3
3 8 10


Output

-1.722222222222222 1.325000000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
const ld EPS=1e-10;
ll n;
ld a[100010], b[100010], c[100010];
int tr[400010], lf, rt;
int qry(int x, int st, int nd){
  if(st>rt||nd<lf)
    return 0;
  if(st>=lf&&nd<=rt)
    return tr[x];
  int md=(st+nd)/2;
  return qry(x*2, st, md)+qry(x*2+1, md+1, nd);
}
void updt(int x, int st, int nd){
  if(st>rt||nd<lf)
    return;
  if(st==nd){
    tr[x]=1;
    return;
  }
  int md=(st+nd)/2;
  updt(x*2, st, md);
  updt(x*2+1, md+1, nd);
  tr[x]=tr[x*2]+tr[x*2+1];
}
bool chck1(ld x){
  vector< pair<ld, int> > v;
  for(int i=0; i<n; ++i){
    v.push_back(mk ((c[i]-a[i]*x)/b[i] , i));
  }
  sort(v.begin(), v.end());
  ll tmp=0;
  memset(tr, 0, sizeof tr);
  for(int i=0; i<v.size(); ++i){
    lf=v[i].sc;rt=n-1;
    tmp+=qry(1,0,n-1);
    lf=rt=v[i].sc;
    updt(1,0,n-1);
  }
  ll tmp1=n*(n-1)/2;
  tmp1=tmp1-tmp;
//  if((tmp1+tmp)%2){
//    return tmp>=tmp1-1;
//  }
  return tmp>=tmp1;
}

bool chck2(ld x){
  vector< pair<ld, int> > v;
  for(int i=0; i<n; ++i){
    v.push_back(mk ((c[i]-b[i]*x)/a[i] , i));
  }
  sort(v.begin(), v.end());
  ll tmp=0;
  memset(tr, 0, sizeof tr);
  for(int i=0; i<v.size(); ++i){
    lf=v[i].sc;rt=n-1;
    tmp+=qry(1,0,n-1);
    lf=rt=v[i].sc;
    updt(1,0,n-1);
  }
  ll tmp1=n*(n-1)/2;
  tmp1=tmp1-tmp;
//  if((tmp1+tmp)%2){
//    return tmp>=tmp1-1;
//  }
  return tmp>=tmp1;
}
vector < pair< ld , int> > v, v2;
ll aa[100010], bb[100010], cc[100010];
int main(){
  ll x, y, z;
  while(cin>>n){
    v.clear();v2.clear();
    for(int i=0; i<n; ++i){
      scanf("%lld%lld%lld",&x,&y,&z);
      aa[i]=x;bb[i]=y;cc[i]=z;
      v.push_back(mk(z/(ld)(y)-x/(ld)(y)*(-2e9), i));
      v2.push_back(mk(z/(ld)(x)-y/(ld)(x)*(-2e9), i));
    }
    sort(v.begin(), v.end());
    sort(v2.begin(), v2.end());
    for(int i=0; i<n; ++i){
      int f=v[i].sc;
      a[i]=aa[f];
      b[i]=bb[f];
      c[i]=cc[f];
    }
    cout<<fixed<<setprecision(10);
    ld st=-1e9, nd=1e9, md;
    ld tmp1, tmp2;
    bool tmp;
    while(nd-st>EPS){
      md=(st+nd)/2.0;
      tmp=chck1(md);
      if(tmp){
        nd=md;
      }
      else{
        st=md;
      }
    }
    tmp1=(st+nd)/2;
    for(int i=0; i<n; ++i){
      int f=v2[i].sc;
      a[i]=aa[f];
      b[i]=bb[f];
      c[i]=cc[f];
    }
    st=-1e9;nd=1e9;
    while(nd-st>EPS){
      md=(st+nd)/2.0;
      tmp=chck2(md);
      if(tmp){
        nd=md;
      }
      else{
        st=md;
      }
    }
    tmp2=(st+nd)/2;
    cout<<fixed<<setprecision(10)<<tmp1<<" "<<tmp2<<endl;
  }
  return 0;
}