Problem: A convex polygon consisting of N vertices is given. The coordinates of each vertex are represented counterclockwise by (X1, Y1), (X2, Y2), ……, (XN, YN). No matter what straight line passes through the point P, find the coordinates of the point P so that the areas of the two convex polygons obtained after cutting are equal.

Constraints

* All inputs are integers

* 3 ≤ N ≤ 50

* 0 ≤ | Xi |, | Yi | ≤ 1000000

* The input polygon is a simple convex polygon.

* The output must satisfy max (| X-cX |, | Y-cY |) ≤ 0.0001 when the output coordinates are (X, Y) and the exact solution is (cX, cY).

Input

The input is given in the following format.

> N
> X1 Y1
> X2 Y2
> ……
> XN YN
>

Output

If there is a point that satisfies the condition of the problem statement, the coordinates of that point

> X Y
>

Output in the format of. If the point does not exist, output "NA" on one line.

Examples

Input

4
100 100
0 100
0 0
100 0


Output

50.00000 50.00000


Input

3
100 100
0 100
0 0


Output

NA

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;

typedef complex<double> P;
typedef pair<P,P> L; //Line, Segment

const int SPLIT = 10000;
const double EPS = 1e-9;

namespace std {
  bool operator < (const P& a, const P& b){
    return fabs(real(a)-real(b)) < EPS ? imag(a) < imag(b) : real(a) < real(b);
  }
}


namespace std {
  bool operator < (const L& a, const L& b){
    return abs(a.first-a.second) < abs(b.first-b.second);
  }
}

double dot(P a, P b){ return real(conj(a)*b); }
double cross(P a, P b){ return imag(conj(a)*b); }
double area(vector<P> v){
  double sum = 0.0;
  int n = v.size();
  for(int i=0;i<n;i++) sum += (real(v[i]) - real(v[(i+1)%n])) * (imag(v[i]) + imag(v[(i+1)%n]));
  return fabs(sum) / 2;
};

int ccw(P a, P b, P c){
  b -= a;
  c -= a;
  if(cross(b,c) > EPS) return 1; 
  if(cross(b,c) < -EPS) return -1;
  if(dot(b,c) < -EPS) return 2;
  if(norm(b) < norm(c)) return -2;
  return 0;
}

P crossPoint(L l, L m){
  double A = cross(l.second - l.first, m.second - m.first);
  double B = cross(l.second - l.first, l.second - m.first);
  if(fabs(A) < EPS && fabs(B) < EPS) return m.first;
  else if(fabs(A) >= EPS) return m.first + B / A * (m.second - m.first);
}

vector<P> convex_cut(const vector<P>& G, L l){
  vector<P> ans;
  for(int i=0;i<(int)G.size();i++){
    P A = G[i];
    P B = G[(i+1)%G.size()];
    if(ccw(l.first, l.second, A) != -1) ans.push_back(A);
    if(ccw(l.first, l.second, A) * ccw(l.first, l.second, B) < 0)
      ans.push_back(crossPoint(L(A,B), l));
  }
  return ans;
}

double getAngle(P a,P b){
  return atan2(b.real()-a.real(),b.imag()-a.imag());
}

double getDeg(double a){
  return 180/M_PI*a;
}

bool eq(double a,double b){
  int k = (int)max(log10(a),log10(b));
  for(int i=0;i<k;i++){
    a/=10.0; b/=10.0;
  }
  //x  printf("%.6lf %.6lf\n",a , b );
  if( abs(a-b) < 1E-5 ) return true;
  return false;
}
int N;
vector<P> V;


int main(){
  cin >> N;
  for(int i=0;i<N;i++){
    int x,y;
    cin >> x >> y;
    V.push_back( P(x,y) );
  }

  double ar = area(V);
  if( ar < 0.0 ){
    reverse(V.begin(),V.end());
    ar = abs(ar);
  }

  vector<L> seg;
  for(int i=0;i<N;i++){
    int pr = (i+N-1)%N;
    int nd = (i+1)%N;
    P st = V[pr];
    P ed = V[nd];
    if( ccw(st,V[i],ed) != 1 ) continue;
    //cout << getDeg(st) << " "<< getDeg(ed) << endl;
    for(int j=0;j<SPLIT;j++){
      P h = (st+ed)/(double)2.0;

      L s = L(V[i],h);
      vector<P> r = convex_cut(V,s);
      double ret = area(r);

      //      cout << V[i] << " ->" << h << " "<< ret << endl;

      if( ret < ar/2.0 - EPS  ){
        st = h;
      }  else if( ret > ar/2.0 + EPS ){
        ed = h;
      } else {
        st = h; break;
      }
    }
    //      cout << V[i] << " -> " << st << endl;
    seg.push_back( L(V[i],st) );
  }

 sort(seg.rbegin(),seg.rend());
 P poin;
 P v1 = (seg[0].second - seg[0].first); 
 v1 = v1 / abs(v1);
 for(int i=1;i<(int)seg.size();i++){ 
   P v2 = (seg[i].second - seg[i].first);
   v2 = v2 / abs(v2);
   if( !( (eq(v1.real(),v2.real()) && eq(v1.imag(),v2.imag())) ||
          (eq(v1.real(),-v2.real()) && eq(v1.imag(),-v2.imag())) ) ){
     poin = crossPoint(seg[0],seg[i]);
     break;
   }
 }
 //x    cout << poin << endl;

  bool f = true;
  for(int i=0;i<N;i++){
    P p = V[i];
    P nex = V[(i+1)%N];
    P ks = (nex-p)/(double)SPLIT;
    for(int j=0;j<SPLIT;j++,p+=ks){
      L s = L(p,poin);
      vector<P> r = convex_cut(V,s);
      //     printf("%.10lf %.10lf\n",area(r), ar/2.0 );
      if( !eq(area(r),ar/2.0) ) f = false;
      if(!f) break;
    }
    if(!f) break;
  }

  if( f ) printf("%.10lf %.10lf\n",poin.real() , poin.imag() );
  else cout << "NA" << endl;

}