// Arup Guha
// 1/9/2024
// A Better Solution to 2016 Dec USACO Bronze Problem: Square Pasture

using namespace std;
#include <bits/stdc++.h>

int main() {

    // Open file (for old usaco not any more)
    ifstream fin("square.in");

    // Read pts.
    int x[4], y[4];
    fin >> x[0] >> y[0] >> x[1] >> y[1];
    fin >> x[2] >> y[2] >> x[3] >> y[3];

    // Close file.
    fin.close();

    // Input is ordered, so we know max's and min's.
    int diffx = max(x[1],x[3]) - min(x[0],x[2]);
    int diffy = max(y[1],y[3]) - min(y[0],y[2]);

    // Take the larger one and square it.
    int sq = max(diffx, diffy);

    // Write to file.
    ofstream fout("square.out");
    fout << sq*sq << endl;
    fout.close();

    return 0;
}
