#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>

using namespace std;

#define x first
#define y second

int getArea(int x1, int y1, int x2, int y2, int x3, int y3) {
    return abs((x1-x2)*(y3-y2)-(x3-x2)*(y1-y2));
}

int main() {
    ios::sync_with_stdio(false);

    int n;
    while (cin >> n, n) {
        map<int, bool> has;

        vector<pair<int,int> > co(n);
        for (int i=0; i<n; ++i) {
            cin >> co[i].x >> co[i].y;
            has[co[i].x+10000*co[i].y] = true;
        }

        int area = 0, mxhyp = 0;
        for (int i=0; i<(int)co.size(); ++i) {
            for (int j=i+1; j<(int)co.size(); ++j) {
                int dx = co[j].x - co[i].x;
                int dy = co[j].y - co[i].y;
                if (mxhyp < dx * dx + dy * dy) {
                    int x3 = co[j].x - dy;
                    int y3 = co[j].y + dx;
                    int x4 = co[i].x - dy;
                    int y4 = co[i].y + dx;
                    if (has.count(x3+10000*y3) && has.count(x4+10000*y4)) {
                        area = max(area, getArea(co[i].x, co[i].y, co[j].x, co[j].y, x3, y3));
                        mxhyp = dx * dx + dy * dy;
                    }
                }
            }
        }
        cout << area << endl;
    }
    return 0;
}