#include <iostream>
#include<stdlib.h>
#include<cstring>
using namespace std;

int main()
{
    int n;
    std::cin>>n;
    int *x=(int*)malloc(n*sizeof(int)),*y=(int*)malloc(n*sizeof(int));
    for(int i=0;i<n;i++)
    {
        std::cin>>x[i]>>y[i];
    }
    int m[20000];
    memset(m,-1,20000);
    int xdiff,ydiff,xm,ym;
    int res=0;
    for(int i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            xdiff=x[i]-x[j];
            ydiff=y[i]-y[j];
            if(m[xdiff]!=-1)xm=m[xdiff<0?-xdiff:xdiff];
            else xm=xdiff*xdiff,m[xdiff]=xm;
            cout<<xm<<"\n";
            if(m[ydiff]!=-1)ym=m[ydiff<0?-ydiff:ydiff];
            else ym=ydiff*ydiff,m[ydiff]=ym;
            cout<<ym<<"\n";
            res+=xm+ym;
        }
    }
    std::cout<<res;
    return 0;
}
