//#pragma optimization_level 3
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
typedef long double db;
int inf = 1'000'000'007;
int vec_prod(int a, int b, int c, int d) {
return a * d - b * c;
}
int scal_prod(int a, int b, int c, int d) {
return a * c + b * d;
}
struct Point {
int x, y;
Point operator+(Point o) { return { x + o.x, y + o.y }; };
Point operator-(Point o) { return { x - o.x, y - o.y }; };
};
Point Get(Point a, Point b, Point c, int x, int y) { // Делим основание bc
b = b - a; c = c - a;
int dx = c.x - b.x, dy = c.y - b.y;
// ans_x = b.x + dx * x / (x + y), ans_y = b.y + dy * x / (x + y)
Point change = { b.x * (x + y) + dx * x, b.y * (x + y) + dy * x };
return a + change;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
//srand(time(0));
//srand(15);
/*
freopen("anniversary.in", "w", stdout);
freopen("anniversary.out", "w", stdo);
*/
int n;
cin >> n;
vector<pair<int, int> > v(n);
for(int c=0; c<n; c++)
cin >> v[c].first >> v[c].second;
//v.push_back(v[0]);
for(int i=1; i<v.size(); i++){
v[i].first -= v[0].first;
v[i].second -= v[0].second;
}
pair<int, int> was = v[0];
v[0].first = v[0].second = 0;
int Sall = 0;
for(int c=1; c<n-1; c++) {
Sall += vec_prod(v[c].first, v[c].second, v[c+1].first, v[c+1].second);
}
Sall = abs(Sall);
int Snow = 0, pos = -1;
for(int c=1; c<n-1; c++) {
Snow += abs(vec_prod(v[c].first, v[c].second, v[c+1].first, v[c+1].second));
//Snow = abs(Snow);
if(Snow * 2 == Sall) {
cout << was.first << " " << was.second << endl;
cout << v[c+1].first + was.first << " " << v[c+1].second + was.second << endl;
return 0;
}
if(Snow * 2 > Sall){
pos = c+1;
break;
}
}
int under = Snow - abs(vec_prod(v[pos-1].first, v[pos-1].second, v[pos].first, v[pos].second));
int over = Sall - under - abs(vec_prod(v[pos-1].first, v[pos-1].second, v[pos].first, v[pos].second));
int triangle = abs(vec_prod(v[pos-1].first, v[pos-1].second, v[pos].first, v[pos].second));
Point ans;
if(under > over) {
int give = under - over;
int left = give*2 + triangle - give;
int right = triangle - give;
Point A = {0, 0};
Point B = {v[pos].first, v[pos].second};
Point C = {v[pos-1].first, v[pos-1].second};
ans = Get(A, B, C, left, right);
}
else {
int give = over - under;
int left = triangle - give;
int right = give*2 + triangle - give;
Point A = {0, 0};
Point B = {v[pos].first, v[pos].second};
Point C = {v[pos-1].first, v[pos-1].second};
ans = Get(A, B, C, left, right);
}
cout << was.first << " " << was.second << endl;
cout << ans.x + was.first << " " << ans.y + was.second << endl;
return 0;
}
Ly8jcHJhZ21hIG9wdGltaXphdGlvbl9sZXZlbCAzCi8vI3ByYWdtYSBHQ0Mgb3B0aW1pemUoIk9mYXN0LG5vLXN0YWNrLXByb3RlY3Rvcix1bnJvbGwtbG9vcHMsZmFzdC1tYXRoLE8zIikKLy8jcHJhZ21hIEdDQyB0YXJnZXQoInNzZSxzc2UyLHNzZTMsc3NzZTMsc3NlNCxwb3BjbnQsYWJtLG1teCxhdngsdHVuZT1uYXRpdmUiKQovLyNwcmFnbWEgR0NDIHRhcmdldCgiYXZ4LGF2eDIsZm1hIikKCgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGludCBsb25nIGxvbmcKdHlwZWRlZiBsb25nIGxvbmcgbGw7CnR5cGVkZWYgbG9uZyBkb3VibGUgZGI7CmludCBpbmYgPSAxJzAwMCcwMDAnMDA3OwoKaW50IHZlY19wcm9kKGludCBhLCBpbnQgYiwgaW50IGMsIGludCBkKSB7CiAgICByZXR1cm4gYSAqIGQgLSBiICogYzsKfQoKaW50IHNjYWxfcHJvZChpbnQgYSwgaW50IGIsIGludCBjLCBpbnQgZCkgewogICAgc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