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

using namespace std;

inline int getArea(int x1, int y1, int x2, int y2, int x3, int y3) {
    return abs((x1-x2)*(y3-y2)-(x3-x2)*(y1-y2));
}
inline int H(int x, int y) {
    return x + y * 10000;
}
inline int X(int v) {
    return v % 10000;
}
inline int Y(int v) {
    return v / 10000;
}

int main() {
    int n;
    while (cin >> n, n) {
        vector<int> co(n);
        int x, y;
        for (int i=0; i<n; ++i) {
            cin >> x >> y;
            co[i] = H(x, y);
        }
        sort(co.begin(), co.end());

        int area = 0;
        for (int i=0; i<(int)co.size(); ++i) {
            for (int j=i+1; j<(int)co.size(); ++j) {
                int dx, dy, x3, y3, x4, y4;
                dx = X(co[j]) - X(co[i]);
                dy = Y(co[j]) - Y(co[i]);
                x3 = X(co[j]) - dy;
                y3 = Y(co[j]) + dx;
                x4 = X(co[i]) - dy;
                y4 = Y(co[i]) + dx;
                if (binary_search(co.begin(), co.end(), H(x3, y3)) && binary_search(co.begin(), co.end(), H(x4, y4))) {
                    area = max(area, getArea(X(co[i]), Y(co[i]), X(co[j]), Y(co[j]), x3, y3));
                }
            }
        }
        cout << area << endl;
    }
    return 0;
}