#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
using namespace std;
const int maxN = 30005;



void solve(){
    int m;
    cin>>m;
    vector<pair<int,int>> v(m);
    for(auto &i:v){
        cin>>i.first>>i.second;
    }
    for(int i=1;i<2;++i){
        map<int,int> cntx,cnty;
        for(int j=0;j<=i;++j){
            cntx[v[j].first]++;
            cnty[v[j].second]++;
        }
        int mn =INT_MAX,ansx,ansy;
        for(auto j:cntx){
            if(j.second < mn){
                mn = j.second;
                ansx = j.first;
            }
        }
        mn = INT_MAX;
        for(auto j:cnty){
            if(j.second < mn){
                mn = j.second;
                ansy = j.first;
            }
        }
        int ans = 0;
        for(int j=0;j<=i;++j){
            ans+=(abs(ansx-v[j].first))*(abs(ansy-v[j].second));
        }
        cout<<ans<<"\n";
    }
}

int main(void){
    solve();
    return 0;
}